Tuesday, October 25, 2016

Photon Functions (Week 7 Reflection)

This was "Open Project Week," where we were invited to work on a project of our choice, as long as it relates to the course syllabus.  I continued my exploration of the Photon, which is something that I started prior to this class.  Continuing my independent inquiry supports this course's learning objective of setting "personal and professional goals for increasing [my] coding confidence."

Since last week, when I got a servo up and running on my Photon, I've had a couple of major breakthroughs.  In particular, I've figured out how to trigger a web request via a QR code.  What that means is that I can now use a QR code to trigger a specific function in my code to "control physical objects," which is another learning objective of this course.  In this case, I can control a servo and a buzzer.  I'm continuing to build upon my understanding of Particle functions.

I've embedded a couple of videos here, but if you are interested in learning more, please visit my personal blog (linked below).

QR Code Trigger a Servo

QR Code Triggers Music


Here are links to my annotated and tweaked code:

Here is my annotated/ tweaked code for the music.
Here is my annotated code for the servo.

You can find a link to the resources I've been curating here.

Monday, October 17, 2016

Reviewing Switches and Exploring Photon: Week 6 Reflection

This week, I dug deeper into how switches work and continued playing with my Photon, a tiny wireless board that is programmed with an Arduino-based language.

This is a headerless Photon, but the one I use to 
prototype with has header pins soldered to it.
The following is a simple sketch for a LilyPad Arduino.  It has two blinking functions; one blinks faster if a switch is toggled from off to on (high to low).  Although I have experience with switches in my work, the concept of a pull-up resistor was something new to ponder.  According to the baldengineer, "When using any kind of 'open' inputs with an Arduino such as switches, push buttons, reed relays, and some sensors, a pull-up resistor is needed for reliable operation. These resistors hold the I/O pin at a known value until the switch forces the I/O pin to a different known value. On each board there are Arduino Internal Pull-Up resistors built-in, they just need to be turned on in the sketch, usually in setup()." My original code didn't specify that I wanted the switch to be an INPUT_PULLUP, rather than just an INPUT, and it didn't work.  When I changed the code, it did!

I also continued working on a personal passion project, which is trying to learn more about the Photon and the Internet of Things.  Like the LilyPad Arduino, the Photon also has built in pull-up resistors.  I haven't used them yet, but I thought I'd mention it.

My goal for the week was to get a servo up and running and connected to Twitter, which I was eventually able to do.  Here is the blog post that I wrote about this.  I've been documenting my work with the Photon on my personal blog for about a month, because I'm hoping to use one in a project I'm building.

Also, since this is a coding class, I spent some time thinking about and experimenting with the code that I used, even if I didn't write it myself. Here is a link to the open source code, along with my annotations.

Monday, October 10, 2016

Playing with LilyPad Arduino: Week 5 Reflection

This week, those in my class who are new to coding were challenged to set up the Arduino IDE on their computers and make LEDs blink, using an LilyPad Arduino.  While I'm not an expert coder by any stretch of the imagination, I am not new to the LilyPad.  As a result, I was invited to challenge myself.  With the leeway to do something that would benefit my learning, I decided to play around with some Adafruit code written for the Gemma, pairing music with individually addressable (color changing) NeoPixels.  My first experience playing with tones on a LilyPad took place two years ago, while following the tutorials in Sew Electric.  Since I hadn't yet attempted to pair music with NeoPixels (or NeoPixels with the LilyPad) this seemed like an appropriate and interesting challenge.

The original code that I started with played a simple five tone tune, the theme from Close Encounters, and lit up the brim of a hat when exposed to light.  My goal was to deconstruct the code (and look for patterns) to see if I could play a different tune and change the LED configurations. My tune is nothing but a scale played forwards and backwards; but, after an afternoon of puttering, I was able to get it to work on a couple of different microcontrollers, including the LilyPad.

One thing that I found really interesting about the original code was the way that the loop calls a function embedded within a function (a music function embedded within the light function).  I tinkered around with the numerator and denominator in the code for the delayAmount and loopTime, to see how it changed things, but I still don't understand how the original values were derived.


Rather than taking screen shots of code from my computer, I've embedded the code using Codebender, a cloud-based Arduino plugin that makes it easy to share code.

Sunday, October 9, 2016

Reflecting on Papert: Week 5

This week in class, we continued reading Seymour Papert's book, Mindstorms: Children, Computers, and Powerful Ideas.  In chapter three, addressing how math is best learned and understood by children, Papert (1980) highlights the importance of learners having a "relationship to it" (p. 65), as well as a "personal need to do something one could not do before" (p. 74).  Learning driven by personal need, rather than the requirement to memorize and regurgitate, is learning that is more "powerful...general...intelligible" (p. 76). Computers, then, with their ability to help children internalize math concepts by applying theorems for the purpose of creating something they want to create, may help students learn how to learn, by allowing them to break larger problems into smaller chunks that might be applicable in their daily lives.  While this book is a seminal work, providing a historical context for Papert's philosophy of constructionism (a philosophy that has notably influenced the way I approach teaching and learning), I've found my mind wandering while wading through it in its entirety.

Wishing for a fresher take on how Papert's ideas play out in our media saturated world, I turned my attention to Connected Code:  Why Children Need to Learn Programming, which was published in paperback this past September.  While Kafai, Y. B. & Burke, Q.  (2016) actively build upon Papert, reinforcing key ideas that he advocates in a variety of publications, it goes further by making the case that coding and programming should be valued less as a form of "thinking and engaging in the individual mind" and more "as a form of participation and expression" (p. 127).  This assertion really jumped out, because it is supported by prior research I've done related to media literacy and the benefits of remixing.  Code is a building block of media that has the potential to influence people's thinking through their exposure to media messages, but it can also enable a citizen to construct and deconstruct their own media messages.  Code is also a building block of physical objects, the design of which are also human constructions, that may also reflect certain social and political values.  Not only does this book do an admirable job of articulating Papert's influences in education, using contemporary examples that are relevant in my life, it extends the conversation to some of the physical tools and materials that I find personally intriguing.

Works Cited

Kafai, Y. B. & Burke, Q.  (2016). Connected code: Why children need to learn programming.  
     Cambridge, MA:  MIT Press.

Papert, S. (1980). Mindstorms: Children, computers, and powerful ideas. New York, NY: Basic Books.

Saturday, October 1, 2016

More Visual Coding and an Intro to Text-based Coding with Vidcode: Week 4 Reflection

This week, we were asked to continue our exploration of visual coding by reviewing the concepts we practiced in Scratch (and a couple new ones).  We reviewed the broadcast command, creating variables, and using if/else statements.  Then, we were given the chance to compare Scratch with a more complex graphical platform, Snap, that allows the integration of more complex loops and functions. One thing that I learned about Scratch, that I didn't know before, is that you can create lists that may be used to substitute out different variables, such as a random interjection or greeting, to make a game seem more interesting. While I saw the immediate value in creating variables for keeping score, for example, or using broadcast to have sprites communicate with one another, I had to watch more than one video to understand why I'd want to use a list.  In this game (also embedded below), I've used if statements, broadcast, and a couple of lists to vary dialogue between my sprites depending upon what was happening.  The object is to use the up, down, left, and right keys to move the puppy to the fire hydrant, without touching one of the crazy squirrels.  There is currently only one round to this game, but I applied a lot of new learning here (and had fun in the process).



I also continued to work through the CS First Game Design challenges, eventually completing them all.


I thoroughly enjoyed Snap's Hour of Code activity, because the scaffolding was just right. By the time I was finished, I'd learned how to program a game with a little critter that moved randomly, and kept getting faster and faster, while I tried to click him with my mouse.  The game kept score, kept track of the maximum score, and would even erase the annoying drawing marks as a gift to any player who reached the maximum score.  I even dreamed about this game, trying hard to remember how certain outcomes had been achieved.  



We were also asked to complete some of the free tutorials offered by Vidcode, in order to compare graphical coding with text-based coding.  I'd heard of Vidcode before, but I hadn't spent much time exploring it prior to our assignment.  I completed all six of the free tutorials, because they were engaging and intuitive, and only took a couple of hours.  I don't have a formal education in Computer Science or coding, but JavaScript seems pretty easy to learn compared with the limited bits of Python I've been trying to better understand.  Text-based coding isn't a new concept for me, but I am in a place where I'm ready to dig deeper and learn more, in order to really do more with it.  I like the way that Vidcode mixes coding with photo and video editing; it's a great way to teach coding concepts in manageable chunks with the possibility of creating something with a pretty funky outcome.  The links to my creations are below, as well as a couple of screenshots.