I program on my arduino uno with de VirtualWire library but the pin 13 led lights and i dont put it on HIGH.And then i program another code and the same thing.After program a basic transmitter program the pin13 lights.
Any reason for this?
Board revision? R3?
Did you use the transmitter example ?
That pulses the system led, if a message is being transmitted.
These lines turn on pin 13 (the system led) and off.
digitalWrite(13, true); // Flash a light to show transmitting
...
digitalWrite(13, false);
I use this code:
#include <VirtualWire.h>
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
char buf1[3];
int i;
void setup() {
attachInterrupt(0,receive_RF,CHANGE);
Serial.begin(9600);
vw_set_tx_pin(3);
vw_set_rx_pin(2);
vw_setup(2000);
vw_rx_start();
}
void loop() {
while (Serial.available() > 0) {
int x = Serial.parseInt();
Serial.println(x);
for(i=2;i>=0;i--){
buf1[i]= x % 10;
x /= 10;
}
vw_send((uint8_t *)buf1, strlen(buf1));
}
}
void receive_RF()
{
if(vw_get_message(buf, &buflen))
{
for(i = 0; i < buflen; ++i)
{
Serial.print((char) buf[i]);
}
Serial.println("");
}
}
De arduino uno is version R3.
If i dont program 13 pin, the led on board lights.Its normal?
Are you talking about your receiver or transmitter?
I just tested it on my Micro which is all wired up to use VirtualWire but LED on pin 13 never lights up so there must either be something with your specific board or your sketch.
I have the arduino uno R3 and if i dont program de pin 13 OUPUT ou INPUT,the led on board lights.I dont know why!
https://www.google.com/search?q=pin%2013%20led%20r3%20site%3Aarduino.cc
http://forum.arduino.cc/index.php?topic=149846.msg1125485#msg1125485
http://forum.arduino.cc/index.php?topic=99087.msg742838#msg742838
http://forum.arduino.cc/index.php?topic=136476
http://forum.arduino.cc/index.php?topic=145769.msg1095342#msg1095342
Thanks Coding Badly,
On Uno R3 an extra logic port was added for the Led at pin 13. If pin 13 is noisy, the led might turn on.
// Keep that funky led at pin 13 off.
// Set it as output, the pin will be default LOW.
pinMode( 13, OUTPUT);