hey guys, i'm new stuff , learning @ uni. i'd appreciated anyones these error messages. great, , sorry novice level....
error messages
sketch_apr09a.ino:6:1: error: stray '\' in program
sketch_apr09a.ino:10:1: error: stray '\' in program
sketch_apr09a.ino:28:1: error: stray '\' in program
sketch_apr09a.ino:3:1: error: 'u2028' not name type
sketch_apr09a.ino:6:2: error: 'u2028' not name type
my sketch void setup() {
pinmode(10, output);
pinmode(7, input);
serial.begin(9600);
}
void loop() {
int sensorvalue1 = analogread(a0);
int sensorvalue2 = digitalread(7);
if(sensorvalue2 == high){
digitalwrite(10, high);
delay(145000);}
for (int fadevalue = 255 ; fadevalue >= 0; fadevalue -= 5)
{analogwrite(10, fadevalue);
}
if(sensorvalue1 > 500){
digitalwrite(10, high);
delay(145000);
(int fadevalue = 255 ; fadevalue >= 0; fadevalue -= 5)
{analogwrite(10, fadevalue);
}
}
else {
digitalwrite(10, low);
}
serial.println(sensorvalue1);
delay(1);
}
error messages
sketch_apr09a.ino:6:1: error: stray '\' in program
sketch_apr09a.ino:10:1: error: stray '\' in program
sketch_apr09a.ino:28:1: error: stray '\' in program
sketch_apr09a.ino:3:1: error: 'u2028' not name type
sketch_apr09a.ino:6:2: error: 'u2028' not name type
my sketch void setup() {
pinmode(10, output);
pinmode(7, input);
serial.begin(9600);
}
void loop() {
int sensorvalue1 = analogread(a0);
int sensorvalue2 = digitalread(7);
if(sensorvalue2 == high){
digitalwrite(10, high);
delay(145000);}
for (int fadevalue = 255 ; fadevalue >= 0; fadevalue -= 5)
{analogwrite(10, fadevalue);
}
if(sensorvalue1 > 500){
digitalwrite(10, high);
delay(145000);
(int fadevalue = 255 ; fadevalue >= 0; fadevalue -= 5)
{analogwrite(10, fadevalue);
}
}
else {
digitalwrite(10, low);
}
serial.println(sensorvalue1);
delay(1);
}
you seem have control codes hidden in code supplied. removed them , compiles okay now. (note use of code tags make more readable)
code: [select]
void setup() {
pinmode(10, output);
pinmode(7, input);
serial.begin(9600);
}
void loop() {
int sensorvalue1 = analogread(a0);
int sensorvalue2 = digitalread(7);
if(sensorvalue2 == high){
digitalwrite(10, high);
delay(145000);
}
(int fadevalue = 255 ; fadevalue >= 0; fadevalue -= 5)
{
analogwrite(10, fadevalue);
}
if(sensorvalue1 > 500){
digitalwrite(10, high);
delay(145000);
(int fadevalue = 255 ; fadevalue >= 0; fadevalue -= 5)
{
analogwrite(10, fadevalue);
}
}
else {
digitalwrite(10, low);
}
serial.println(sensorvalue1);
delay(1);
}
Arduino Forum > Using Arduino > Programming Questions > Confused with a basic error
arduino
Comments
Post a Comment