Monday, January 12, 2009

Hello Blink!

Everybody seems to be messing with Arduino lately. So today was my chance to give it a go. Jimmie Rodgers of Willoughby and Baltic helped me set up the software on my laptop at Noise Night. It was incredibly easy, and he helped me to understand that the IDE for the 'regular Arduinos' is different for that used on the Minty POV and Brain Machine.

Stephanie, one of my Programming students had a piece of code running on her laptop and wanted to test it with four LEDs. We set up a breadboard with the LEDs, and she got her program to run. She had it going Cylon style, where the light would pass from side to side. After she left, I noticed the breadboard sitting on the table, still hooked up to the arduino, so I figured I would give it a whirl. I plugged it into the USB port, fired up the IDE and saw her program run.

Then I decided I wanted to mess with it on my own, so I did a search for "Hello World Arduino" Hello World is usually the simplest program you can run in a computer language. I wanted simple, so I could understand what it was doing. I found the code, which is also in the Help Menu under something or another, but I couldn't find it easily. I recalled that Jimmie had told me that Blink is the first program you want to run.

I copied the code and pasted it into the script window. Then I had to figure out how to get it to the board. I hit the Compile window, which looks like a play button, and saw that it compiled. I tried changing a few things, and broke it.

Earlier, Stephanie had some basic problems as well, such as not spelling the variable names exactly the same throughout the code. Hand typed code is case sensitive, so it's important not to mess with it too much. When we were debugging her code, I put some comment marks ( // ) in front of the lines that were throwing the errors. Eventually, we figured out that the problem was capitalization.

After compiling, I had to save the file, and then download it to the board. I was very happy when I saw that one LED blink. After about a half a minute, I got bored, and started messing with the code. I tried changing the duration of the blink and pause, and then I made each of the four LEDs do thier blinky thing.

So now I have made an Arduino blink. There is so much more that can be done, but it all has to start someplace. This step for me has been a major block. For some reason, I haven't been able to get it going. But now it is going. Hopefully others may find this moment useful. If you do, let me know in the comments.

Labels: , , , , ,

Friday, June 06, 2008

Solar Panel simulator in Scratch

Learn more about this project

This is a project I have been cooking up this week to combine Solar Energy with Scratch. Scratch is a programming environment created by the Lifelong Kindergarten Group at the MIT Media Lab.

You can move the mouse over the left hand side to show a sprite which will allow you to adjust the brightness. If you have access to a Scratch Board, this script makes use of the light sensor on the board.

Labels: , , , , , , ,

Monday, February 18, 2008

Fab Lab and Scratch Field Trip - Saturday Programming

On Saturday February 17, Tim Hovey and I took our Saturday Programming group on the road. The South End Technology Center (SETC) hosted us for the day, where we worked in the Fab Lab in the morning, then experimented with Scratch in the afternoon. We were met by Ed Baafi, who runs the Fab Lab portion of SETC. Ed introduced us to the lab and some of its possibilities. Mel King, who runs the South End Technology Center stopped by for a bit during the morning. Michael Nagle assisted the group in the Fab Lab. Amon Millner of the Lifelong Kindergarten Group at MIT worked with us on Scratch.

We ended up taking the T, but there was some kind of track repair and trains were not running on the usual tracks. Taking the train added at least 45 minutes to our travel time in. I guess that kids ride free on the train, so we actually saved a lot by not having to pay $50 for parking two cars. As it was, it ran $110 to bring the group in and feed them.

Mr. King was there for a few minutes, but I didn't get much of a chance to talk. Things were busy, kids were figuring out how to work the equipment and get what they needed. Nagle helped out with the late morning part of the day. There was a definite Creative Buzz in the room. The kids figured out their pecking order for who would cut on the laser. When Amon finished up his conference, he stopped by. When I left, Geoff and Amon were handling the lab and lockup.

The kids had a great time in the lab. They were all able to make things of their own design, starting with a cardboard product and working up to plexiglass when they had their design right. OpenOffice was new to most of them, making designs that are based on only lines was also a new concept. Kids tend to design stuff with color. The laser doesn't care about color, only line.

The scratch session was not as productive as I had hoped. They did figure out how to do a bunch of things, but we could have used about another hour to really get some product. The scratch boards don't work with the older version of the software on most of the machines. Most of the kids made accounts on the Scratch site, and saw how to find it by searching for scratch, top entry on the google search. They sounded like they would like to do some more experimentation with it. In about an hour and a half, they were getting the software to work and programming their animations to do what they needed. Alec did a demonstration on how to get the background to change. With headphones, they could hear the audio of what they were programming.

Angela tells me that the group dynamic was a bit off by her observation. She would have liked to work with more of a variety of kids. Two of them were spending too much time working together. I had to tell a some of the boys to moderate their behavior. These suburban kids really don't have their 'city faces' yet. They were excited.

On the whole, everybody agreed that it was a fun time, and they would all like to go back again. We will do some work with scratch at home and in our saturday sessions. I will also see about bringing them over to the high school to show them some of the possibilities there.

At this point, there are some parts of it that can and should be repeated with other groups:
We introduced new users to the lab. We showed some of the things that other people had done in the lab, such as some furniture made on the Shopbot and prototypes made on the lasercutter. We demonstrated the software tools of open office and CAM. All the participants had enough time to design at least one thing on open office draw, make a series of cardboard tests, with the lower settings, then a finished piece with the more powerful settings to cut in plexiglass. They had to measure their piece, and place the cut on a piece of plexi that had already been cut by other users. Some of them had the opportunity to make relatively complex designs by merging shapes to remove interior lines. The older kids made more representational pieces, alien, spaceship, star in a circle, while the younger participants were active in making shapes which had their names or other words etched onto the interior. Everybody was able to make something of their own imagining that they could carry a physical representation of out the door. They were universally interested in returning to the lab to make more.

Nagle's reference to Buzzing Creativity - Link

Scratch Website - Link
South End Technology Center Website - SETC Site

Ed Baafi runs the fab lab portion of SETC link
Mel King runs the South End Technology Center - link
Amon Millner works on the Fab Lab and Scratch projects at the Media Lab link
Alec Resnick is a senior at MIT, helped facilitate in the lab - link
Mike Nagle is an MIT grad, runs a summer camp in cambridge, will help facilitate - blog link and Camp link
Chris Connors is a technology and engineering teacher at Duxbury High School and cofacilitator of the Saturday Morning Programming Group - Connecting link and blog link
Tim Hovey is a programmer by profession and helped initiate the Saturday Programming group to fill an unmet need for teaching kids how to use the computer as a tool through programming.

Labels: , , , , ,