Hi Folks,
I'm a newbie to coding and I keep getting this error when trying to upload. It's probably something small
but I can't seem to get the code uploaded to the board.
Any help would be great, thanks
Here's is the code:
/*
HEATPAD CONTROL
Turns on and off a LED connected to digital pin 7,
and a heatpad connected to digital pin 3
when triggerd by a sensor connected to pin A0.
*/
const int outPin = 7; // select output pin (LED)
const int heatPin = 3; // select output pin (heatpad)
int sensorPin = A0; // select input pin (sensor)
int lightLevel, high = 0, low = 1023;
void setup() {
pinMode(outPin, OUTPUT);
pinMode(heatPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
int sensor_value = analogRead(0);
int lightLevel = analogRead(0);
int manualTune();
analogWrite(300, 800);
if (sensor_value < 15)
// prints the value into the serial monitor
Serial.print(sensor_value );
// turn the LED on - this is just to show circuit is working
digitalWrite(outPin, HIGH);
// print to serial monitor
Serial.println("-Light on, yurt");
// turn the heatpad on
digitalWrite(heatPin, HIGH);
// print to serial monitor
Serial.println("-heat on yurt");
delay(1000);
}
void manualTune() {
lightLevel = map(lightLevel, 0, 1023, 0, 255);
lightLevel = constrain(lightLevel, 0, 255);
}
else {
// prints the value into the serial monitor
Serial.print(sensor_value);
// turn the LED off
digitalWrite(outPin, LOW);
// prints the value into the serial monitor
Serial.println("-Light off");
// turn the heat pin off
digitalWrite(heatPin, LOW);
// prints the value into the serial monitor
Serial.println("-heat off");
// delay for ease of reading
delay(1000);
}
}