Hello everyone,
I am trying to climb the steep learning curve of programming.
I am trying to use a nano to control mc145155TESTscanlcd.ino (20.3 KB)
a scanning receiver. PLL and scan functions.
I have a few issues but I will address just one for this post.
while(digitalRead(12)==1) ; //during signal detected, wait. //at this point when the signal (pin 12) //goes low, I want to wait a few seconds, recheck pin 12 and if it is high again, redo the while loop. //keep doing this until the signal is low after the few second delay.
++sum; //increment scan
if(sum > 46) //reset channel to 1
{
sum = 1; //sum is used by switch ... case to select channels
}
Those who are familiar with radio scanners may be familiar with what i am trying to do. presently as soon as the signal is lost it continues scanning channels.
Thank you
Michael
Thank you, I'll give it a shot.
I do need to understand the
delay(a_few_seconds*1000UL);
part .
A variable times 1 second? not sure what the "UL" means.
yes, I am very much a newbie.
UL forces the result of the multiplication of your seconds times 1000 milliseconds into an unsigned long variable. Also needed because default unsigned int will overflow at about 32+ seconds.
Leo..
I gave up and used a hardware solution with a 74ls123
I can handle hardware fine, but this software makes my eyes bleed.
It's like trying to understand an alien language.