Posts Tagged ‘ AVR

ATmega328 + LM75 (AVR i²C Temp)

serial terminal

ATmega328 + LM75

 

 

 

 

 

 

 

 

 

My first Arduino experiences

See Arduino Language Reference for more info

#include <Wire.h>
#define address 0x48

int temperature,i;

void setup()
{
  Wire.begin();
  Serial.begin(9600);
  Serial.println("ser!al - Temp (LM75) v1");
}

void loop()
{
  Wire.beginTransmission(address);
  Wire.requestFrom(address, 1);

  if (Wire.available()) {
     temperature = Wire.read();
  }
  Wire.endTransmission();
  Serial.print("---Loop(");
  Serial.print(i);
  Serial.println(")---");
  Serial.print(temperature);
  Serial.println(" C");
  i++;
  delay(1000);
}