## Christmas Crib music and light with Arduino

Ok this is my first arduino project. My wife has made a christmas crib using card boxed and papers, and I thought it would be nice if there is some Christmas music and light ðŸ™‚ I bought one SparkFun Inventor’s Kit that contains Arduino last time for my lessons, and I thought I should make use of it.

This is the photo of the christmas crib: http://flickr.com/gp/oka/YLf8X5

and some videos: http://youtu.be/wYa5OGcBqNM

Software:

Hardware:

• Arduino Uno R3
• 1 x push button
• 5 x 330 Ohm resistors
• 4 x LEDs
• 1 x Buzzer (Piezo element)

The breadboard connection is shown here: http://flickr.com/gp/oka/548y52

This is the photo of the prototype: http://flickr.com/gp/oka/uT05WW

This is what it looks like after my wife put it on the Christmas crib: http://flickr.com/gp/oka/WzAx94

## Drawing world for “soar” simulator

We are currently using “soar” simulator from MIT to teach programming SOPH303 Digital World. In that simulator, we first need to load the so called world. The world is basically a python file. An example for boundaryWorld.py is shown in the figure below.

The lines of code to create the world is shown here:

dimensions(4,4)
wall((0,3),(1,3))
wall((1,3),(1,4))
wall((2,0),(2,2))
wall((2,2),(3,2))
initialRobotLoc(2, 3)

The first line sets the dimension of the world in meters (x dim, ydim). The wall function set up a straight line wall from two points (x1,y1) to (x2,y2). The initialRobotLoc function places the robot at the position (x,y) in the world. The initialRobotLoc function can accept the third parameter, which is the angle in radians with respect to the horizontal x axis. So if you want the robot to point north,

initialRobotLoc(2,3,math.pi/2)

That’s it.