I want to know if this possible.
I am using 4 force density sensors each sensor correspond n,s,e,w.
if the sensor is press
it will increment
example
n= n++
if the n value will be going to 10
then
it will light up leds like a trafficlight
then the n value will return to value of zero
then the other will continues counting up to 10.
using void loop
I didn't try yet due to i am researching all the ideas i need from making the traffic light last night i am having problem making a counter in the void loop thats why i am asking here. if you can help show me an example a continues counter logic. Thank you in advance
if n<100 then
ncounter =ncounter++
else if s < 100 then
scounter =scounter++
else if e < 100 then
ecounter =ecounter++
else if w< 100 then
wcounter =wcounter++
end if
if ncounter =10 then
ncounter=0
and set the LED to high
......................................
i will ask if the previous values of the scounter,wcounter,ecounter will be retain?
if you can help show me an example a continues counter logic.
You need to explain more precisely what you want. Do you want the counter to increment indefinitely or do you want it to reset back to 0 after a certain number of counts?
If you write down a clear description in plain language it will often help you to see a solution.