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.

Continue reading “Automated Scissors – Updated!”

Automated Scissors

To follow up on my previous issue with LED blinking… I decided instead of flashing, the LED should stay on to indicate when the servo is moving. I did explore a few methods for blink without delay using millis(), but I had trouble making it only blink when the button was pressed and only for the duration of the servo’s motion. Anyways, I automated a pair of scissors using a servo. It runs at two speeds depending on how fast you want to cut some paper. Here is a gif of it in action.

Continue reading “Automated Scissors”

Working with Servo Motors

I am currently working on this week’s project for Physical Computing and I am running into some issues with servo motors. Specifically, how I can do other things while the servo motor is running.

First, I’ll go over what I’ve done so far to check that certain parts of my circuit and code are definitely working. I started by making a circuit to control the servo using a potentiometer. Before putting in a servo, I used an LED to make sure I wired the potentiometer correctly.

Next, I swapped out the LED for my servo and updated my code to use the servo library.

All of this was working great. So I know for this week’s project I want to have a servo that will go through its motion and then return to the original position after it completes its travel. I am able to get this working as shown below.

And then because I will have an option (via push buttons) to choose a slow or fast speed, I want the LED to blink either fast or slow accordingly. I added the LED blinking code using delays, but it slows down my servo’s motion to a crawl.

I know it’s going through the delays each time it loops to move my servo, so I am looking into ways to avoid using delays to get my LED to blink. Or is it only possible stop the slowing down by running one output at a time? I doubt it, so I’m going to keep looking into solutions.