hello,
this code simple never works.
when type 1 or 0 in serial monitor on arduino ide 1.6.3
i cannot see "led on" or "led off" on monitor
the led never lights ( digital pin 3 ---330 ohm resistor ---led(anode)--- led(cathode) ---gnd)
i have no idea issue is.
footnote: using arduino uno r3 powered usb cable on windows 7
thanks lot.
code: [select]
#define led 3
int bytereceived;
void setup()
{ pinmode(led, output);
serial.begin(9600);
serial.println("--- start serial monitor send_rcve ---");
}
void loop()
{
if (serial.available() > 0)
{
if (bytereceived == '1')
{
digitalwrite(led, high);
serial.print(" led on ");
}
if (bytereceived == '0')
{
digitalwrite(led, low);
serial.print(" led off");
}
}
}
this code simple never works.
when type 1 or 0 in serial monitor on arduino ide 1.6.3
i cannot see "led on" or "led off" on monitor
the led never lights ( digital pin 3 ---330 ohm resistor ---led(anode)--- led(cathode) ---gnd)
i have no idea issue is.
footnote: using arduino uno r3 powered usb cable on windows 7
thanks lot.
because never read serial interface
Arduino Forum > Using Arduino > Programming Questions > serial send and receive never works
arduino
Comments
Post a Comment