Pages: [1]   Go Down
Author Topic: Counting questions..  (Read 142 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
Karma: 0
Posts: 118
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well two questions...

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

so.. approx:-

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?

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.


« Last Edit: February 03, 2013, 12:23:05 pm by mrfunk » Logged

East Anglia (UK)
Offline Offline
Faraday Member
Karma: 118
Posts: 4337
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Pages: [1]   Go Up
Jump to: