Non riesco a fare verificare dall IDE arduino 0018 questo programmino:
import processing.serial.*;
Serial myPort;
void setup(){
println(Serial.list());
myPort = new Serial(this, Serial.list()[1], 9600);
}
void draw(){
if(keyPressed){
if(key=='a'){
myPort.write(65);
}
else{
if(key=='d'){
myPort.write(97);
}
}
if(key=='c'){
myPort.write(98);}
else{
if(key=='b'){
myPort.write(118);
}
}
}
}
int ledPin = 12;
int val = 0;
void setup(){
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop(){
val=Serial.read();
if(val =='a'){
digitalWrite(ledPin, HIGH);
}
if(val=='d'){
digitalWrite(ledPin, LOW);
}
if(val=='c'){
digitalWrite(ledPin1, HIGH);
}
if(val=='b'){digitalWrite(ledPin1,
LOW);}
}
Ricevo questo errore:
error: 'import' does not name a type In function 'void setup()':
In function 'void draw()':
In function 'void setup()':
In function 'void loop()':
Perchè??? come risolvo?? ho cercato dappertutto..aiutatemi!xD