newbie needs simple help
pongmstr2
Posts: 16
hello all,
i'm working on a project for work that needs to flash an led 30 times in 10 seconds when a button is pressed. I convinced my boss that the propeller was the perfect thing for this. i'm just having some problems with the programming. the hardware i can manage. this is the code i have so far. it works the first time the button is pressed but thats it. I know it is a simple piece of code. can anyone please help me.
pub toggle
repeat
if ina[noparse][[/noparse] 0 ] ==1
dira[noparse][[/noparse]4..9]~~
repeat until outa[noparse][[/noparse]9..4]++ == 60
waitcnt(clkfreq/6 + cnt)
dira~
i'm working on a project for work that needs to flash an led 30 times in 10 seconds when a button is pressed. I convinced my boss that the propeller was the perfect thing for this. i'm just having some problems with the programming. the hardware i can manage. this is the code i have so far. it works the first time the button is pressed but thats it. I know it is a simple piece of code. can anyone please help me.
pub toggle
repeat
if ina[noparse][[/noparse] 0 ] ==1
dira[noparse][[/noparse]4..9]~~
repeat until outa[noparse][[/noparse]9..4]++ == 60
waitcnt(clkfreq/6 + cnt)
dira~
Comments
Have you read the tutorial and PE Kit Labs?· They come with the Propeller Tool.
John Abshier
when you paste code into the forum, it's important to use the CODE tags so your indentation is preserved. Paste your code between
[noparse][[/noparse] code ]
and
[noparse][[/noparse] / code ]
except remove all the spaces I placed within the brackets.