Hello,
I am newbie and I want to make an extension for chrome to communicate with my arduino.
I have arduino sketch (Physical Pixel) that reads commands which are sent through the serial port and turns on a led. I works fine with integrated arduino termnal.
Code:
const int ledPin =13;// the pin that the LED is attached to
int incomingByte;// a variable to read incoming serial data into

voidsetup(){
// initialize serial communication:
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin,OUTPUT);
}

voidloop(){
// see if there's incoming serial data:
if(Serial.available()>0){
// read the oldest byte in the serial buffer:
    incomingByte =Serial.read();
// if it's a capital H (ASCII 72), turn on the LED:
if(incomingByte =='H'){
digitalWrite(ledPin,HIGH);
}
// if it's an L (ASCII 76) turn off the LED:
if(incomingByte =='L'){
digitalWrite(ledPin,LOW);
}
}
}
And now I want to write an extension for chrome to send commands "L" and "H" through serial port, like ardino's ide terminal.
I found some examples but one of them is working. This exapmle only shows which port is connected. And now I only have to add a few lines of code to this example to send some data via usb serial, but it is hard for me for a start point. I can not figure out how to do it. Can somebody help me please? Sorry for grammar