Thanks to projects like Code.org and MIT Scratch, students can encounter ideas from computer science using rich puzzle interfaces. Using these puzzle interfaces, students grow their skills of creativity and critical thinking while building something fun. Puzzle based programming interfaces put emphasis on the student learning sequencing, loops, and connecting appropriate pieces together. In this post, I wanted to share my experiences with Ardublock, a puzzle based programming interface for the Arduino platform. Using the most recent beta of Ardublock, I found that I could create an Arduino program to control motors quickly. I’m looking forward to seeing how students in our makerspace will enjoy the software.
The Arduino platform enables makers and students to program experiences involving electronics or sketches. You can learn more about this platform from the following blog post. In our previous blog post, we used Arduino, Lego’s, and a few servo motor’s to create a small toy crane. In this sketch, the user can move the crane by sending a character to the Arduino through the serial monitor.
- w – moves the crane up.
- s – stops the crane.
- x – moves the crane down.
- a – moves the crane left.
- d – moves the crane right.
In the crane setup, pin 9 of the Arduino is connected to a standard servo. Pin 9 will be used to move the crane left and right. Pin 10 will be used to move the crane up and down. We initialize our variable for the direction or angle of the crane. We also send an angle of 90 degrees to both servo motors to ensure that the motors stop moving.
In the Arduino platform, the programmer needs to define a main loop of functionality. In the crane control program, we start the process by accepting a character from the serial port and storing the character in a variable called “input.” If we receive the character ‘d’ for move left, then the system changes the angle variable and writes the angle to the servo motor. You can see the Ardublock code below. The character ‘a’ for move right operates in a similar manner. When we receive the characters x and w to move up and down, we write an appropriate value to the continuous rotation servo. (0 = move up, 180 = move down)
When using Ardublock, the student is not hidden from the C code generated by the tool. The student can be encouraged to change the C code. I see this as a nice learning advantage. I want our students to make the connection between puzzle pieces and traditional code.
If you’re interested in learning more about this free and open source product, check out the following link:
http://blog.ardublock.com/engetting-started-ardublockzhardublock/
Top Stories on InspiredToEducate.NET
Learning To Code
- Easy Data Visualization with Google Charts and JavaScript
- Learn to Build Your Own Conversational Bot using ChatScript
- 10 Free Resources for Learning JavaScript and HTML5
- 17 Fun Tools To Teach Kids To Code by @ChrisBetcher
- Benefits of Teaching Kids To Code That No One Is Talking About
- Easy Recipes for Building Android Apps using MIT App Inventor
- 12 Steps To 3D Print Your Minecraft Creations
- How to Build Your Mobile App using HTML
- Simple Minecraft Programming Using ScriptCraftJS
Science Education
- Why hate science?
- 7 ideas for creating a student centered learning environment by Paul Andersen
- Using candy to teach DNA structure