Hello... Just got into Arduino with the use of it in Tinkercad. I have the LED sequencing part going, 8 red LED's going from 1-8 just like an old Bearcat Electra III scanner I have. What I am trying to do is use the arduino to control the LED's and use a Raspberry Pi for the audio. I know I will need a small audio amplifier to output to the speaker but what I want to do is pause on the current LED when audio is present say on analog pin A0 then resume the sequence once there is no audio present. It doesn't have to stop on a certain LED every time, it could be any of them. The arduino and pi will eventually find their home in an old Bearcat Electra III to be able to listen to a "scanner" that the pi will be controlling and providing audio from.
The code I currently have is:
void setup()
{
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
}
void loop()
{
digitalWrite(1, HIGH);
delay(75); // Wait for 75 millisecond(s)
digitalWrite(1, LOW);
digitalWrite(2, HIGH);
delay(75); // Wait for 75 millisecond(s)
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
delay(75); // Wait for 75 millisecond(s)
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
delay(75); // Wait for 75 millisecond(s)
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
delay(75); // Wait for 75 millisecond(s)
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
delay(75); // Wait for 75 millisecond(s)
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
delay(75); // Wait for 75 millisecond(s)
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
delay(75); // Wait for 75 millisecond(s)
digitalWrite(8, LOW);
}
I have seen by looking on how I could make this smaller but I just need to get it working the way I need it and the arduino will be only doing the led's and nothing else. Any help will be appreciated as my coding skills only date back to the C64 days and I have forgot most of that but want to learn more about this and with help I will better understand it.
Thanks
RJ