arduino communicate with C++ (code blocks)
<p>I have an Arduino and I would like to communicate with my computer. I would like to use usb (COM3) ( I think it is the easiest way). I use C++ ( Code Blocks) on my computer.
I wan't to send an variable from computer to my arduino.</p>

<p>I've written the Arduino code:</p>

<pre><code>// receiver
int data;

void setup() {
    Serial.begin(9600);
    pinMode (13, OUTPUT);
}

void loop() {
    if (Serial.available()) {
        data = Serial.read();
        if (data==1){
            digitalWrite(13, HIGH);
            delay(100);
        }
    }
    digitalWrite(13, LOW);
}
</code></pre>

<p>I want to write the sender code in C++ ( Code Blocks) which send an variable (data=1) .</p>

<p>Can you help me?</p>
