Firmware for microcontrollers (e.g. Arduino Mega2560) to interface peripherals (sensors & actuators) with a single board computer (e.g. Raspberry Pi 3).
This code should be able to be relatively hardware agnostic but has only been tested on Arduino Mega 2560 as of May 22, 2016. The idea is that this repo can be cloned / downloaded and be able to run on the ArduinoIDE AND platformio. ArduinoIDE users will need to add the submodules found in this repo's /lib to ~/Documents/Arduino/library.
The example code in the submodules (i.e. openag_am2315) should function properly in both the ArduinoIDE (File/Examples/<submodule name>/example) and in platformio (openag_phalange/lib/<submodule>/example). This means that each example functions as a standalone platformio package.
- Clone repo: git clone <repo name>
- Configure git update: git config --global alias.update '!git pull && git submodule update --init --recursive'
- Update repo: git update
- Install platformio: pip2 install -U platformio
- Connect arduino to rpi w/USB cable
- Compile and upload: pio run -t upload
- cd <submodule dir>
- git checkout master
- git pull
- cd <module dir>
- git commit
- git submodule deinit <submodule>
- git rm <submodule> # Note: <submodule> (no trailing slash)
- rm -rf .git/modules/<submodule>
- cd <submodule>
- git checkout master
- <hack,edit>
- git commit -a -m "commit in submodule"
- git push
- cd ..
- git add <submodule>
- git commit -m "Updated submodule"
- initialize: pio init --board megaatmega2560
- compile: pio run
- compile & upload: pio run -t upload
- serial monitor: pio serialports monitor