// Chapter 7 - Communications // I2C Master // By Cornel Amariei for Packt Publishing // Include the required Wire library for I2C #include int x = 0; //using the PV amps input PA03 physical pin 19 int oven_temp_sensor = 03; int sensorValue = 0; void setup() { //Start the I2C Bus as Master Wire.begin(); Serial.begin(9600); pinMode(oven_temp_sensor,INPUT); } void loop() { sensorValue = analogRead(oven_temp_sensor); Serial.print("Sensor Value is:"); Serial.println(sensorValue); Wire.beginTransmission(9); // transmit to device #9 Wire.write(sensorValue); delay(1000); Wire.endTransmission(); // stop transmitting }