Help with Propeller programming.
chelleteng
Posts: 29
(In Public method)
repeat
(codes)
showBPM(DotYpos, 2)
(codes)
PRI showBPM(num, counter) | count, bpm
gr.colorwidth(0,0)
gr.box(-128,-100,60,30)
if num > 0
count++
bpm := count - (count - ++counter)
showDEC(bpm)
else
showDEC(0)
***
[The showDEC method is just a function to display the numbers on the screen.]
Altered from Chip Gracey's Graphics Demo codes,
how do I increase the counter every time the num is more than 0? What I am currently getting on the display is constantly 3 only..
The program has only increment the counter once whenever the num is more than 0.
Any ideas? Thank you!
repeat
(codes)
showBPM(DotYpos, 2)
(codes)
PRI showBPM(num, counter) | count, bpm
gr.colorwidth(0,0)
gr.box(-128,-100,60,30)
if num > 0
count++
bpm := count - (count - ++counter)
showDEC(bpm)
else
showDEC(0)
***
[The showDEC method is just a function to display the numbers on the screen.]
Altered from Chip Gracey's Graphics Demo codes,
how do I increase the counter every time the num is more than 0? What I am currently getting on the display is constantly 3 only..
The program has only increment the counter once whenever the num is more than 0.
Any ideas? Thank you!
Comments
count := 0
@Chelleteng ..Quick hint. read this and pay attention to code format http://forums.parallax.com/misc.php?do=bbcode
to analyse what is going on I would insert debugcode into your actual code.
I mean sending the values of each variable involved into the calculations over a serial connection using pin 31,30 to see
what all the values are and how they change from loop to loop.
In this I would be more extensive than quick and short.
serial.str(string("count=")
serial.dec(count)
serial.str(string(" num=")
serial.dec(num)
serial.str(string("counter=")
serial.dec(counter)
serial.Tx(13)
for each and every single variable that is involved into the calculation
best regards
Stefan
Thanks everyone for all your answers and help! Really appreciate it!
Thank youu!