-
Notifications
You must be signed in to change notification settings - Fork 9
1. Setting up the Feather HUZZAH microcontroller
Adafruit's Feather HUZZAH board comes with a Lua interpreter. That's cool, but what if you want to use it and your write code in Javascript?
One option is to reflash the board with Firmata and then use a Javascript framework like Johnny-Five. Another option is Flasher.js, which reflashes the board with Espruino to run Javascript natively. Both options allow for control of the board over WiFi.
Flasher.js sounds really cool and looks like it might be simple to get up and running, but it was just released very recently, and I haven't had the chance to try it yet. So, step-by-step instructions for setting up the Feather HUZZAH using Firmata and Johnny-Five are below. If you're feeling adventurous, feel free to try Flasher.js at your own risk! Incomplete instructions are at the end of this page.
- If you haven't already done so, download and install the prerequisites.
- Open the Arduino IDE and choose Preferences. Find the Additional Board Manager URLs field and enter the following URL:
http://arduino.esp8266.com/stable/package_esp8266com_index.json. - In Tools > Board > Board Manager, search for ESP8266 and install the corresponding package.
- In Tools > Board, select Adafruit HUZZAH.
- Open terminal and run
git clone https://github.com/firmata/arduino.git ~/Documents/Arduino/libraries/Firmata. Once this is complete, restart the Arduino IDE. - In File > Examples > Firmata, select StandardFirmataWifi. You'll need to make a few changes to this code.
- Line 85 of StandardFirmataWifi.ino: uncomment
#define SERIAL_DEBUG(delete the //). - Line 998 of StandardFirmataWifi.ino: add the following line:
analogWriteRange(255) - Line 119 of wifiConfig.h: Set char ssid[] to the name of the WiFi (SSID) your laptop is connected to.
- Line 151 of wifiConfig.h: Set wpa_passphrase to the password of the WiFi your laptop is connected to.
- Select File > Save As and save your firmware with a new name like StandardFirmataWifi-NodeBots.
- Plug in the board and select the COM port for your USB device under Tools > Port.
- Go to Tools > Serial Monitor to open the serial monitor.
- Click the verify button in the Arduino IDE (checkmark on the top left toolbar). Once your code is verified, upload it by clicking the right arrow button. Once you see that the code has been uploaded 100%, you are good to go!
- In the serial monitor window, you should see a device IP address. (If not, press the RESET button on the Feather board.) Make note of this IP address, then close the serial monitor and Arduino IDE.
- You can now disconnect the Feather from computer. When you use the Feather wirelessly, you can power it the USB power bank through micro USB port on the Feather. This will power the Feather but not the motors.
These are incomplete instructions just to get you started. Good luck, Adventuresome One! Note that you do not need to complete these instructions if you have done the steps above already.
- If you haven't already done so, download and install the prerequisites.
- Visit the Flasher.js development guide and the Espruino projects page to get a sense for how to use the platform.
- ???
- NodeBot!