Go Down

Topic: Counting questions.. (Read 315 times) previous topic - next topic


Feb 03, 2013, 06:05 pm Last Edit: Feb 03, 2013, 06:23 pm by mrfunk Reason: 1
Well two questions...

I want to count how many times something happings in a loop..

so.. approx:-

Code: [Select]
int countTEST=0;

Void  loop:-
{If(blah,blah )

++countTEST;// this increments the count by 1}


so I've got that..

If I wanted my display to display the count..
would this work?
Code: [Select]

my second question is i would want an led to blink a number of times, to indicate waht the count number is,-- (this is really where I'm stuck.




You have a variable that holds the number of times to blink the LED, which is a good start.  Have a look at the 'blink without delay' sketch to see how not to tie up the processor whilst blinking an LED.

Please post the whole of your existing program to get more help but read the 'sticky' thread at the beginning of this section of the forum before you do.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131