I am working on a consumer product that uses an arduino to control a neopixel LED ring. I wrote a library that allows me to define and animate "layers" (group of RGB pixels with position, color, opacity, etc) which are composited and displayed on the LED ring.
For now I am configuring my layers in the code itself, but ideally the end user will be able to define his own layers. So here are my questions relating this process:
I assume I can store some sort of data file to the EEPROM and read it in order to configure the layers. Right now I am using a hardcoded char array to define each layer. Any direction on how one would load data from a file and convert it into the desired char array?
What is the simplest way for the user to edit the data file on the EEPROM? Ideally the consumer wouldn't have to install the arduino ide or drivers or any of that stuff. What is the absolute easiest path for the consumer to plug it in and be able to edit/upload the data?
I should also note that I am very new to C++, but have learned quite a bit writing the layer library.
Basically, you'd want to build an app (using the language of your choice) that would allow the user to define the data (however that is accomplished is up to you) - then upload that definition to the Arduino via the serial connection.
The end user wants an app for their iPhone that connects to the Arduino project with bluetooth or wifi. To to that you need to be able to develop an iOS App, which can only be done on a Mac and it costs money to get the development tools. It also costs money adding a bluetooth or wifi shield onto the Arduino.
Closer to the end of the spectrum that's easiest for you is to develop a PC program in Processing and use that to communicate with the Arduino, much like the Arduino IDE does.
The absolute easiest to program is to use the Arduino serial monitor (or any other terminal program) to talk to the Arduino over USB. You then need your sketch on the Arduino to provide all of the "main menu" and other stuff that will appear on the screen in the serial monitor.
Aha perfect. I should have mentioned I am an experienced web app developer, so creating the UI to generate the layer data is no problem.
I will investigate throwing together a quick bash script to communicate with the arduino to start off with.
Using Bluetooth or WiFi definitely makes for the best user experience, but for now that would drive costs too high. Certainly a good version 2 feature.
rDr4g0n:
I will investigate throwing together a quick bash script to communicate with the arduino to start off with.
I have seen a few Threads in which people had problem getting bash scripts to communicate with an Arduino. I don't know that subject well enough to know if the problems could have been overcome. However Python works very well.
You need to be aware that opening a serial port cause the Arduino to reset if it is connected via USB.
After posting I did some research and found a number of libraries for nodejs serial communication, and a few blog posts with examples of using nodejs to proxy requests from browser to the arduino.
I plan to write a web page with a nice UI that allows the user to create the animation they want. The page will also have options to send that animation data to the arduino. When the user clicks send, the data will goto the nodejs backend, which will send it to the arduino's serial port which is (hopefully) connected via usb. The arduino will write that data to its EEPROM, and next time it's reset (or maybe I can force it to reboot?), it will read that data and the resulting animations will be the user generated ones.
There's a tool called node-webkit that lets you package node and webkit together so that the user won't have to worry about installing nodejs to get thing working.
Thanks for the help everyone. Hopefully ill be reporting back with a nice finished product soon
rDr4g0n:
I plan to write a web page with a nice UI that allows the ...
I should have said that I wrote a simple web page to control my model trains first using JRuby and Sinatra and later converted to Python and Bottle. My system has bi-directional comms so there is a background Thread running continuously to communicate with the trains.