hi all,
i am trying to access a temperature sensor with my arduino mini. i got the code to work on my arduino NG but i need to run it with my mini. i am getting no response whatsoever from the analog ports of the mini ( i have now tried them all ).
i have a picture of the sensor with the NG here: http://dasautomat.com/wp-content/uploads/blog/tempSensor_med.jpg
on the NG i am using analog ports 4 and 5. the problem is that someone else wrote the code for me and I don´t know where the ports are defined in the code.
anyone got an idea? thanks in advance
and here is the code:
#include <Wire.h>
#define MSB 0
#define LSB 1
void setup(void) {
Wire.begin();
Serial.begin(9600);
Wire.beginTransmission(72);
delayMicroseconds(10);
Wire.send(0xEE);
delayMicroseconds(10);
Wire.endTransmission();
// initialize inputs/outputs
// start serial port
}
void loop(void) {
byte tempByte[2];
int which;
int temp;
delayMicroseconds(50);
Wire.beginTransmission(72);
delayMicroseconds(50);
Wire.send(0xAA);
delayMicroseconds(50);
//Wire.beginTransmission(72);
delayMicroseconds(50);
Wire.requestFrom(72,2);
delayMicroseconds(50);
which = MSB;
while(Wire.available())
{
tempByte[which] = Wire.receive();
delayMicroseconds(50);
which++;
// Serial.print(c);
}
// temp = 8<tempByte[MSB] | tempByte[LSB];
delayMicroseconds(50);
Wire.endTransmission();
Serial.print(tempByte[MSB], DEC);
Serial.print(".");
Serial.println((tempByte[LSB]>>7)*5, DEC);
delay(250);
// program here
// code_block;
}