Part 1: LED Arduino Exercises
Example 1: Turn on an LED while the button is pressed
Difficulties and Solution
I couldn't figure out the "What is a switch?" example to turn on the LED with a button. I eventually found Massimo Banzi's example in the pdf version of his book (found here) which helped me figure out how to do this circuit. He uses a push button switch in his example, but I didn't. That's where the two wires from the "What is a switch?" example come in. You just have to touch the two ends of the wire together to light up the LED, which is basically what happens you press down on a switch button — two wires touch.
Example 2: Press button to turn on LED, press again to turn off, innocent version
Difficulties
Just pasted the new code into the IDE. The circuit doesn't work like it's supposed to. My guess is that Arduino is reading the values really quickly as soon as we turn on the switch aka touch the ends of the wires, so turning the LED on/off becomes random.
Example 3: Only change LED state on button transition
There were no difficulties in this experiment. In the new code, the introduction of the variable old_val only changes the LED upon pressing the switch because the instant after you turn on the LED, old_val becomes LOW again because Arduino is constantly digitalRead-ing the input value.
Part 2: Automaton
Ideation
I built off of last week's assignment to use gears to translate rotary motion to linear motion in combination with Chris's introduction to boxes. Boxes reminded me of shoe boxes and I really love Nikes, so my idea was to make a Nike box that houses gears and moves an Air Jordan logo up and down to look like he's dunking.
Iterations and Process
I first made the gears using a gear generator and measured the holes to be the size of lollipop sticks, which were going to be my rods. I then made a finger joint box using makercase, but the joints came out too thin and didn't work because there wasn't enough material to glue together.
I made another box using boxmaker, which came out great. At this point, I realized I hadn't planned far enough. I sketched out the rest of my plan with more details and an action list of what I needed to do to complete my automaton.
In the end, my automaton...doesn't work. I miscalculated where to cut the holes on the side walls of my box where the rods are supposed to be and didn't account for so many factors such as correct hole sizes, friction between gears and rods, and where to correctly place things in relation to one another. Also, I didn't attach the box correctly. I thought the finger joints would just work but I overlooked that and had to use rubber bands.
Results and Lessons
1. Sketch and annotate A LOT.
2. Walk myself through actually making it to find out things I might not have considered at first.
3. Get accurate measurements.
UPDATE: I ended up finishing this project. Here's a video of it working!
Here's a breakdown of the pieces that were used in the final iteration.
The final iteration consisted of four main modifications from the previous iteration. First, in order to prevent MJ from slipping off the cam next to the gear, which happened frequently before, I stuck a second cam together with the first to increase the surface area MJ would be on. I also added a wider radius circle to the end so to completely ensure MJ would always be moving.
Second, MJ would be "loose" a lot of the time in the previous iteration. By "loose", I mean that the rod attached to him would have large degrees of freedom for movement when it goes through the slit on the cover. To solve this, I laser cut a few slit pieces and glued them together so that MJ's rod would be restricted to solely up-and-down movement.
Third, I added a hoop and backboard to the box using a brass rod and laser cut acrylic. Similar to the rod problem above, the hoop's rod would also move freely. I added a base at the bottom with a hole as big as the rod's diameter so that once you added the hoop, it would directly fit and stabilize.
Finally, I added a crank for better ergonomics.
This project is now finished! If you want to make this, feel free to message me if you have any questions or if you want the Illustrator files used for laser cutting. Bill of materials is documented in the Hackster software and hardware section.
References:
Comments