RF transmitter newbie question

I have a very simple question regarding and RF transmitter. I am a newbie and am stuck with a bit of code.

Making the transmitter transmit:

byte counter;
void setup(){
//2400 baud for the 434 model
Serial.begin(2400);
counter = 0;
}
void loop(){
//send out to transmitter
Serial.print(counter);
counter++;
delay(10);
}


Making the LED blink:

void setup() {                
  // initialize the digital pin as an output.
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(5000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(5000);              // wait for a second
}

I'm missing the part where it knows that the transmitter is transmitting, thereby setting off the LED to blink.

Any help would be greatly appreciated :slight_smile:

I'm missing the part where it knows that the transmitter is transmitting, thereby setting off the LED to blink

That's the bit that requires a receiver.

That's the bit that requires a receiver.

And the use of the Serial.available() and Serial.read() functions.

Not to mention some idea how the value of counter is supposed to relate to when the LED turns on or off.

Hi,

Sorry, my question is unclear. What I mean is I want the board the the transmitter is attached to to give me a visual sign (the LED blinking) that it is actually transmitting.

I am using a RF Link Transmitter - 434MHz

The code keep the transmitter transmitting continuously:

/*
* Simple Transmitter Code
* This code simply counts up to 255
* over and over
* (TX out of Arduino is Digital Pin 1)
*/
byte counter;
void setup(){
//2400 baud for the 434 model
Serial.begin(2400);
counter = 0;
}
void loop(){
//send out to transmitter
Serial.print(counter);
counter++;
delay(10);
}

What I mean is I want the board the the transmitter is attached to to give me a visual sign (the LED blinking) that it is actually transmitting.

It is transmitting every time the UART writes a 1 to it.

(please use the "code" (#) icon on the editor's toolbar when posting code)

Sorry it is still not clear. Have you got two arduino's ?
One with a transmitter on and one with an receiver on. The description of your transmitter is not enough, we need model number and make, preferably a link to the data sheet.

Thank you, I have a possible solution. I am using the transmitter and the receiver in the field with batteries so I wanted a visual reference on the outside of the case that the transmitter is transmitting (the LED).

byte counter;

void setup(){
  //2400 baud for the 434 model
  Serial.begin(2400);
  counter = 0;
  //LED
  pinMode(13, OUTPUT);
}

void loop(){
  //send out to transmitter
  Serial.print(counter);
  counter++;
  delay(10);
  //LED
  if(counter%1000==0) //every 10 seconds
    digitalWrite(13, HIGH); //set the LED on
  else if((counter+500)%1000==0) //every 10 seconds, 5 seconds offset from above
    digitalWrite(13, LOW); //set the LED off
}

Yes, there is a receiver, but it is just the transmitter I am working on so far.

Transmitter: RF Link Transmitter - 434MHz from sparkfun

You have been asked once, now please modify your post

please use the "code" (#) icon on the editor's toolbar when posting code)

Three strikes and your out

Sorry, modified. :blush:

Thanks.

If you just want a flashing LED while you do something else look at the "Blink without delay" sketch in the example menu. Set up a flag while you are transmitting and include this flag in the if() statement that checks the millis() timer.