P Comp

Automated Scissors - Updated!


Since this was a catch up week, I worked on fixing up my automated scissors project to reflect my original intent. This means I solved my problem of making my LED blink while the servo was in motion.

It turns out that using code for "blink without delay" solved my problem. However, it still took me an embarrassingly long time to figure out where to slide this piece of code into the rest of my Arduino sketch. I initially had it running outside of my loops to make the servo move and had it run when the "swtichState" variables were HIGH. I think this didn't work because the loop that moves the servo had to completed before doing anything else. I also tried using Tom Igoe's Interval library, which I couldn't make work for only the button press. Finally, I moved the blink without delay code into the right spot and my servo and blinking LED combination works! It needed to start right before the servo begins to move inside of the loop. Here it is working with the code below.


Here is the full code for this project now. The circuit is still the same from my previous post.