Thursday, April 9, 2015

Adventures with Arduino, pt 2

We received a partially built sciborg. We began by soldering wire to our battery pack and screwing down the pack and attaching the arduino and protoboards to the sciborg (which I will file under skills that I don't have but really probably should). We were introduced to the bricktronics Lego NXT shield which allowed the arduino board to talk to the lego motors that moved the sciborg. In the end, our sciborg looked like this:


We opened up a sample 'single motor' code and edited the code to work with both motors. We discovered that the minimum code that the motors needed to move was about 20. We made a sketch that experimented with hard and gentler turns by changing the difference between the speeds of the two motors. 


We wrote a sketch that made the sciborg travel 10 feet then stop (and played with the individual motor spped in order to make it drive as straight as we could):


We used currentMillis to get as close to the 10 foot mark as we could.

We also installed a touch sensor, which we used to tell the sciborg when it ran into something and wrote a sketch so that our sciborg traveled forward, stopped when it hit a wall, backed up a bit, turned a bit, and went on its way (it reminded me of the iRobot vacuum). 

And our video of the sciborg in action:


We also played with the touch sensor and LED so that when we touched the sensor, the LED would light up (the following video is the result after we edited the code so the LED would turn off after we released the touch sensor instead of staying on forever):


Part three included my partner and I diving deeper into the endless abilities of the sciborg.

1 comment:

  1. Good job following the steps chronologically. That being said, I would have liked to have seen some more explanation of the codes to make it easier to follow. Overall though, nice work:)

    ReplyDelete