system
May 20, 2014, 8:41pm
#1
I’m getting alot of errors and need help fixing this code. Thanks
const int LEFTTURN_LED_PIN = 9;
const int RIGHTTURN_LED_PIN = 10;
const int SENSOR_PIN = 0;
void setup()
{
}
void loop()
{
int sensorValue;
sensorValue = analogRead(0);
}
if (sensorValue < 525)
{
void loop()
{
digitalWrite(9,HIGH);
delay(1000);
digitalWrite(9,LOW);
Delay(1000);
}
else (sensorValue > 525)
{
void loop()
{
digitalWrite(10,HIGH);
delay(1000);
digitalWrite(10,LOW);
Delay(1000);
}
}
{
int
analogWrite(LEFTTURN_LED_PIN, );
analogWrite(RIGHTTURN_LED_PIN, );
}
system
May 20, 2014, 8:46pm
#2
void loop()
{
int sensorValue;
sensorValue = analogRead(0);
}
loop() looks good, if a little pointless - can’t see any problems there.
What is all the code that isn’t in a function supposed to do?
Delay(1000);
I can’t see the definition of “Delay()” - what is it?
system
May 20, 2014, 8:54pm
#3
I'm trying to troubleshoot this code for a LED bike blinker that is controlled with a soft potentiometer.
system
May 20, 2014, 8:59pm
#4
Before you try troubleshooting it, get it to compile.
system
May 20, 2014, 9:03pm
#5
We are in a high school engineering class and are stuck with this project that is due tomorrow and we have no idea whats wrong and its 35% of our grade, if you could help us out that would be stellar. We don't know much about coding let alone how to "compile" something, basically all we were taught was how to turn on an LED with an Arduino.
system
May 20, 2014, 9:07pm
#6
Comments (intention) would be welcome, but
analogWrite(LEFTTURN_LED_PIN, );
analogWrite(RIGHTTURN_LED_PIN, );
makes no sense at all
(We get this every Spring)