Hello,
I'm currently using my arduino uno to control a lamp. I am new in arduino. My lamp is working fine, but only for two on/ off. My code is really simple, I can not find something wrong. I have two arduino uno so I test this situation on both of them. I am really messed up. Does anyone have any idea of what happening?
const int Pin = 8;
int incomingByte;
void setup() {
Serial.begin(9600);
pinMode(Pin, OUTPUT);
}
void loop() {
incomingByte = Serial.read();
if (incomingByte == 'H') {
digitalWrite(Pin, HIGH);
}
else if (incomingByte == 'L' ) {
digitalWrite(Pin, LOW);
}
}
When I run my code I am receiving this error:
processing.app.SerialNotFoundException: ? ???????? ???? "COM8" ??? ???????. ????????? ??? ????? ??? ?? ????? ???????? > ???????? ????;
at processing.app.Serial.(Serial.java:191)
at processing.app.Serial.(Serial.java:77)
at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:77)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:175)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
at processing.app.Sketch.upload(Sketch.java:1671)
at processing.app.Sketch.exportApplet(Sketch.java:1627)
at processing.app.Sketch.exportApplet(Sketch.java:1599)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2380)
at java.lang.Thread.run(Thread.java:619)
This error causes the entire Arduino IDE when I run my code through that to freeze, and requires a restart of the IDE; also the USB cable must be unplugged and replugged in for the board to be detected again.