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:

and some videos:


You can download the source code from this link.


  • 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:

This is the photo of the prototype:

This is what it looks like after my wife put it on the Christmas crib:

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 is shown in the figure below.


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

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,


That’s it.