This stuff worked very cleanly in MSP430. Problem is that people are doing a lot more basic stuff with Arduino at the moment so interrupts don't seem to have caught on just yet.
Anyhow, here's what I was trying to do :
Push the button and get the uC to play the Melody. Didn't work, so then I say just blink the LED. That also doesn't work.
This much I see :
(stuff you have to know is that every program in Arduino has a "setup()" and a "loop()")
I light up the pin 13 LED within loop.
Then, I set the ISR to clear the LED, delay and the light it up again.
Doesn't work - all I see is it clears the LED. Come on, this is really simple.
Then, Lefty tells me that you can't use delay within your ISR.
WTH!!
The goal, BTW, is to get through Igoe's book. Great guy - saw him at Maker Faire. Seems to have done everything I want to do. Now, while the economy's got me down is the time.
Anyhow, 11:35 at night, nailed the interrupt thing - can play Melody at the press of a buton. Now, to try out one serial example from Igoe's book and call it a day.
No comments:
Post a Comment