first, the FW tutorial does tell you to first read the getting started with flora guide. Make sure you do this. this will ensure your computer has the drivers as needed. But the Adafruit tutorial covers the transfer of files and definitions in a way that (to me) seemed more complicated than needed, so the way I present below is just an alternative method. both work just fine.
Once you have verified your drivers are ok, you should also have your Arduino IDE platform installed already. So, let's proceed.
In the getting started guide, it tells you to download the appropriate IDE zip file. Both are quite similar, but I am focusing on Windows platform here. fyi, if you are attempting to use Linux arduino IDE, you are on your own. As far as I can tell, it's not possible to use linux for this code and a windows/mac VM won't work either. There are certain functions included in the FW code that simply are not supported in the linux version and I couldn't get the linux beta version to comply either. The IDE will see the flora and you can write other code just fine, but the FW code has issues. I recommend sticking with Windows or crApple just to save time and you cannot use a windows VM because the USB device disconnects when you upload your code. unless you have a way to automatically re-attach the usb device to the VM, the VM won't see the flora and can't finalize the upload.
Unzip the file to a temporary location. Open folder /hardware/arduino and locate boards.txt. Copy this file and place it in your matching Arduino folder, overwriting the file. In winXP the location is C:\Program Files\Arduino\hardware\arduino. If you dont wish to overwrite the existing file, just open the new file and search for "flora". Copy everything starting at flora to then end of the file, then paste it into your existing boards.txt file. This will import the new board definitions you need for flora, as well as gemma and trinket.
Now that you have the necessary definitions, you will also need the variant files the definitions are referencing. Copy folder /hardware/arduino/variants/ and paste it into C:\Program Files\Arduino\hardware\arduino. If you don't wish to copy the whole folder and overwrite the existing folders, then just make sure the "flora" folder and any other missing folders are copied to your existing C:\Program Files\Arduino\hardware\arduino\variants folder.
now restart your arduino IDE. from here, you should be able to run all of the provided code on the adafruit tutorial. but the code is not the only problem you might face...
when you get your test circuit up and running, make sure you run both the test code and the final code. notice the differences when you tap the velostat paper. the test code will actually respond to the step sensor. the final code actually varies on the pressure detected by the step sensor. light steps produce a small reaction while heavy steps produce a much larger neopixel reaction.
Aside from that, there are do's and don't with the velostat paper:
|less tape is more|
- in order to get the velostat to send the needed signals, the pressure must occur on a piece of velostat where both the upper thread and the under thread are crossing. imagine the upper thread going from northwest to southeast, while the under thread is going northeast to southwest. the center where those two threads cross is the "cross point" where the velostat will react. if you place pressure on any other point on the velostat, the neopixels will not react based on the provided FW code. You can adjust the FW code, but I am not going into that.
- DO NOT use a lot of tape on the velostat. any part of the velostat that has tape on it will not react as it should and thus won't send the needed signals to the flora or other arduino board. I recommend using just one piece to anchor the end of the thread to the center of the velostat. Loop it around a few times, then add a piece at the edge of the velostat to prevent it from moving around much. But do your best to make as many cross points as possible. The more points you have to work with the FW code will respond better. Whatever you do, do NOT just cover the whole surface in tape or another adhesive.
- DO keep the threads opposite from each other. the picture above shows the upper thread going northeast while the under thread goes southeast. this will work for testing but for production it can present problems. if the two threads touch/cross, they will send false signals to the flora and the neopixels will flash unexpectedly or they may not flash when they should. So when you place the velostat in the shoes, you will want to ensure the threads can't possibly
too much tape
- Once you have figured out a decent cross threading method, you will want too test the velostat on actual shoes. Here you will find the sole of the shoe is critical. If you plan to hide the velostat under the sole, I recommend finding some kind of insole that has a very hard/solid base. if the base of the insole has any kind of cushion (and most do), it will not provide the needed pressure to allow the velostat to react. maybe some factory shoe insoles are different, but I don't have the means to test them all. the tutorial shows the use of all-stars which have some very, very thin insoles. I use skate shoes which are made for absorbing shock, so not the best choice without replacing the insoles.
To correct for this, I cut up a plastic container to make an upper and lower piece of plastic to use as pressure points to sandwich the velostat together. the lower piece goes under the velostat and the upper piece goes on top, but under the ball of your foot. Again, if you find an insole with a
|hard plastic to sandwich the velostat with thread exiting on opposite sides.|
Gluing the LEDs is harder than it looks. If you are using shoes you like or maybe new shoes, then you will likely mess up the first time leaving lots of excess glue on the base which doesn't look that great. I recommend dry placement of the LEDs around the shoe and then add the rubber bands. once the LEDs are secured by the rubber bands, move the bands a few inches out and then pull up the LED strip so you can squeeze in the glue. then just move the rubber bands back into place. once all but the bent sections of the shoe are glued, go back and move the LED strip into its ideal height from the base as it will have moved slightly when you started gluing the opposite side.
|flora on the tongue|
Here is a working prototype using default code from the tutorial.
Here is the finished assembly:
Cannot find a Leonardo....this usually means the USB is not recognized by the computer anymore. Unplug the USB from the computer and plug it back in. then check the TOOLS menu on the arduino IDE and see if the SERIAL item is available. if it's not disabled, make sure the available COM port (or whatever the mac equivalent would be) is selected. if it's still disabled, try unplugging/plugging again. or reboot. the arduino needs a usb device.
A9 is not defined....this happens mosts when you either haven't selected the Flora as the board you are using, or you haven't (correctly) installed the drivers for the Flora on your machine. If it can't find a flora or doesnt know what it is, then it won't know what pin A9 is.
LEDs not reacting to step...obviously check your connections for the upper and lower threads located between both sides of the velostat. make sure the two wires/threads are not crossing at all. if everything looks ok, time to add some debug code to the program. Below is what I did to see what the sensor was outputting.
Upload this new code and then use the serial monitor to watch the output. Put some pressure on the step sensor and release...watch the serial monitor and see if the values change as you add pressure. if the values change then your arduino is getting data from the sensor. if the "stepFiltered" value does not fall below 200 no matter how much pressure you add, then there is some problem with the velostat sensor. maybe the placement of the threads is bad or the velostat is defective. time to experiment. if the values fall low enough, then either the flora is not sending the signal to the neopixel strip, or the neopixel strip is not getting power. you can test the strip by touching and releasing the 2 sensor wires/threads. once they make contact and then separate, the strip should light up similar to a normal functional step. if the flora is sending a signal to the strip, then you can use a voltmeter and place the negative end on a flora ground and the positive end on the A6. add pressure to the step sensor then release and watch the voltmeter for any kind of change. if no change, the flora is not sending any signal to the strip.