Saturday, March 24, 2012

Upgrading from the UNO3 to the Arduino Mega

I decided that it was time to upgrade from the UNO to the MEGA. I started mapping out how many pins I would need for the accelerometer, the magnetometer, the gyroscope, the wheel encoders, the xbee, the motor drive shield, and the range sensors. The pin count added up to much more than was available on the UNO. The MEGA is about twice the size (physically) and has a lot more potential. I also purchased a prototype shield to help stack some of these devices together. Here are the parts I am using:

  1. http://store.nkcelectronics.com/megashield-kit.html
  2. http://arduino.cc/en/Main/ArduinoBoardMega

First, here is a picture of the two boards side by side.


The shield took some assembly. First here is a look at all the parts (below). Then I soldered all the headers on; this took some effort as there was a lot of soldering to do.


After that, it was onto soldering on the resistor, capacitor and LED. Make sure the LED is hooked up with the long wire connected to the positive terminal. Then the reset and a few of the header pins.


Finally, I stacked the shield, the xbee card and then the motor shield onto a stack.


Finally connected it all to the dfrobot platform. Now I have enough pins on the front to start to look at the encoders and range sensor.


Next, I reworked the CMakeLists.txt files a little bit. I put a top level define for the board and the port:

## Generate code for the specified board
#
set(PROJECT_BOARD uno)

## Set the device 
#
set(PROJECT_DEVICE /dev/cu.usbmodem621)

And then had the lower level build files use those variables. That way I easily change the board to build against at the top level of the tree.

As usual, the code can be found at: https://github.com/mark-r-stevens/Ardadv







No comments:

Post a Comment