Hello guys!
I have just start a new project. I want to register my temperature in my living-room, and when the Celsius is over "30", i want a LED to react. Bellow you can see my coding (i'm totally beginner). I will not work
- Anyone who can help me, or will post the correct code?
Thanks a lot for your time!
- Mads Bach Laursen /Denmark
INFO:
LED = pin 13
SIGNAL = A0
HERE IS MY TRYING CODE:
int led = 13;
void setup() { //This function gets called when the Arduino starts
Serial.begin(115200); //This code sets up the Serial port at 115200 baud rate
int led = 13, OUTPUT;
}
void loop() { //This function loops while the arduino is powered
int val; //Create an integer variable
val=analogRead(0); //Read the analog port 0 and store the value in val
Serial.println(val); //Print the value to the serial port
delay(1000); //Wait one second before we do it again
if (Serial.println(val) < "30");
{
digitalWrite, 13;
int led = HIGH;
}
}