So this Arduino board has been replaced by newer boards with better keyboard controls that can use commands like the keyboard.xxx series, like keyboard.begin and keyboard.write. With that said, I wanted to flash my Mega 2560 with some new firmware. There are plenty of instructions for doing this with the UNO but with the MEGA 2560 (especially the R3) it was a little less straight forward. So instead of reinventing the wheel, I’ll just try to post the differences here. Of course the disclaimer of if you damage your board it’s not my fault, etc. holds true here.
1. Follow the instructions here and get an updated firmware to do what you’d like. In fact, you should mostly follow this article except for the instructions I put below specifically for the Mega 2560 R3 if you’re having trouble and keep getting the “dfu-programmer: no device present” error.
2. Here are the command line instructions for using the DFU programmer with Ubuntu Linux. I have Ubuntu 14.04 at the time of this writing. They are slightly different than the above link.
sudo dfu-programmer atmega16u2 erase
sudo dfu-programmer atmega16u2 flash “Whatever_You_Called_It_New_Firmware”.hex
sudo dfu-programmer atmega16u2 reset
That’s it really. The original instructions are good, it’s just that some of us need the above instructions to flash the R3. Obviously the key was to use atmega16u2 instead of 8u2 or at90usb82.