Hi Everyone,
I got my first Core last week and was straight into playing with tinker and some of the online examples.
Now it’s time for my own project, what I’m trying achieve is on the face of it probably quite simple for most people here.
But i’m a noobie to the spark core and only just started learning C++
I want to have 8 x opto couplers controlled by the digital GPIO pins.
The hardware side is very simple and I’ve already tested a simplified circuit with a few optos by using the tinker app.
The functionality I need is :
1-The user sets a possible delay for each of the outputs in the range of 0 to 1000ms, this information is uploaded to the core.
2-The user then sends one GO! signal to the core over wifi from a mac/pc or smartphone and all outputs are fired with the previously uploaded delay settings if any.
I can just about figure out how to do the above as a “one shot deal” by using online build and flashing the core every time I want to change those delay times.
But I would like to build a simple GUI in which the delays could be set and have a GO button.
Could anyone point me to some examples of anything similar or any suggestions as to what the best method may be?
The “playback” needs to be reliable and very accurate, I have read various posts here saying that the Spark’s cloud and wlan functions can possibly cause timing issues with code that is running on the core. Is this the case and how would it be best avoided ?
Eventually I would like to use the 8 analog pins to control another 8 opto couplers as well, could these GPIO be run in a similar manner or at the same speed ?
I’ve read various things about the analog GPIOs, I understand that they are not truly analog outputs but use pwm, so in theory i could just write 0 or 255 to turn an opto connected to them off/on.
Is there anyway to simplify the way I would want to use these pins ?
I know I have a lot to learn so thanks in advance for any advice.
Cheers,
mala