energia / Energia

Fork of Arduino for the Texas Instruments LaunchPad's
http://energia.nu
Other
793 stars 673 forks source link

Building Firmata for the MSP430? #385

Closed jdarling closed 10 years ago

jdarling commented 10 years ago

I noticed that in the repo you have a libraries branch with Firmata in it, but in the Windows download this doesn't exist. I tried just copying it out and placing it into the examples folder and that didn't work. Also tried just opening the ino file but that didn't work either. Any chance you can provide some direction on how to use Firmata with the MSP430?

I'd like to try tying it up to Johnny-Five and see how it compares to my existing setup with an SparkFun Red Board.

rei-vilo commented 10 years ago

I guess the Firmata folder is a legacy from the Arduino IDE. Energia is a fork if Arduino.

robertinant commented 10 years ago

The firmata folder should not have been in the distribution. I know that @adrianF-TI has ported Firmata to the MSP430 as part of the Twitter controlled RGB LED project. Maybe he can point you to the library for you to use.

shengzhao91 commented 10 years ago

jdarling, here is what I did to port Firmata to Energia. Download the entire Energia file from GitHub. You should find the Firmata folder under (Energia-master\libraries). Copy this Firmata folder to "\hardware\msp430\libraries". Run energia.exe. Go to File->Examples->Firmata->StandardFirmata. (Note Firmata should be added below the grey line) Let me know if it works for you.

jdarling commented 10 years ago

Well that got me closer, but didn't quite work. I get an error stating "Please edit Boards.h with a hardware abstraction for this board" Will have to take a look at it when I have a bit more time. I'm guessing there is probably a define or something missing. Will post more when I get a bit to take a look.

shengzhao91 commented 10 years ago

Seems like you got the library copied correctly. You need to edit Boards.h under hardware/msp430/libraries/Firmata/Board.h (assuming you are using msp430). Read through the arduino definitions and create your own #elif define for your board. For testing purposes, change VERSION_BLINK_PIN, TOTAL_PINS and IS_PIN_DIGITAL first.

robertinant commented 10 years ago

See the merge here: https://github.com/energia/Energia/commit/6c169bb43607ea148af406f671d3eba816ce9d63 Firmata now works with most LaunchPads.

shengzhao91 commented 10 years ago

Please let me know if you see any bugs in the Firmata code. I have been actively working on it.