Hello,
I'm new with programming and never did any programming. I need to make an automated radio message relay.
For this I am considering Arduino, I've ordered an arduino Uno and a 4 relay module, the relay's will act like button pushers for a radio transmitter and an mp3 player.
Relay 1: Activates the radio transmitter
Relay 2: Acts as a Key press for Play button on the Mp3 Player
Relay 3: Acts as a Key press for Stop button on the Mp3 Player
Relay 4: Activates a Standby LED
This is the code I've managed to write and since my Arduino has not arrived yet, I have no way to test the code and I don't know how to formulate a delay until milliseconds count reaches a certain value:
/*
Automated Radio Relay
*/
void setup() {
pinMode(13, OUTPUT); //radio
pinMode(12, OUTPUT); //play
pinMode(11, OUTPUT); //stop
pinMode(10, OUTPUT); //led
}
void loop() {
timer0_overflow_count=0; //reset millis to 0 at top of each loop so no overflow issues
digitalWrite(13, HIGH); //Activates Transmitter
digitalWrite(12, HIGH); //Activates Play Button on Mp3 Player
delay(500); //0.5 Seconds Delay
digitalwrite(12, LOW); //Deactivates Play Button on Mp3 Player
digitalWrite(11, LOW); //No action on the Stop Button
digitalWrite(10, LOW); //Deactivates the Standby LED
delay(38000); //Delays any action until transmision message ends
digitalWrite(13, LOW); //Deactivates the Transmitter
digitalWrite(12, LOW); //No action on the Play Button
digitalWrite(11, HIGH); //Activates the Stop Button
delay(500); //0.5 Seconds Delay
digitalWrite(11, LOW); //Deactivates the Stop Button
digitalWrite(10, HIGH); //Activates the Standby LED
delay(until millis equals:1500000); //here is my problem how do I formulate this?
}