hello everyone,
i wanna turn an LED on and off (Arduino UNO) using two buttons developed in vb.net (2012) windows aplication form. Can someone please help me write arduino sketch as well as vb.net code.
thank you very much.
hello everyone,
i wanna turn an LED on and off (Arduino UNO) using two buttons developed in vb.net (2012) windows aplication form. Can someone please help me write arduino sketch as well as vb.net code.
thank you very much.
Have the arduino read the serial port. When you receive an 'H', turn the led on. When you receive an 'L', turn it off. You can test this by itself using the serial monitor in the IDE.
On the vb side, you can use OpenSerialPort and write. The usb connections will appear as serial ports - it may take a little experimentation to find which one is connected to the arduino. Then you just need one button to send 'H' and another to send 'L'.
that totally makes sense. however, i am a newbie in arduino programming, can you please help me with the actual code ?
thank you for your reply.
can you please help me with the actual code ?
void loop()
{
if(Serial.available() > 0)
{
char c = Serial.read();
if(c == 'L')
{
Serial.print("samarth_gohil really needs to turn the lights off");
}
else if(c == 'H')
{
Serial.print("samarth_gohil really needs to turn the lights on");
}
}
}