I am trying to setup a network of multiple sensors. How many apps can I run using spark.io/build at same time? and is there an way to combine all the sensor data to same app?
hassan_sp17, the Spark Core does not run many apps per say. The IDE compiles one “program” which can be made up of multiple tabs (files). That program can do multiple tasks depending on how you write your code. With the IDE, you can flash the same code to multiple Cores if you wish.
To combine the sensor data, you have many options. All the data can either be “published” by each core or made available through Spark variables. You could have a Raspberry Pi subscribe to the published data or fetch the data from the core via their Spark Variables. These are just some ways. The right way depends on what you are trying to achieve.
@peekay123 so if want to flash my project in this order
i’ll set the spark wifi to manual and let it sleep (the wifi will only listen to 1 connection)
if the button is pressed it will automatically connect given the credentials in the code
2.1) having it pressed there will be a separate LED blinking from the spark’s led
- the separate LED will be parallel to the sparks LED whereas, when it’s on listening mode the separate LED will blink red until the spark is connected to the wifi, it will just make a solid and steady green.
after connecting to the wifi, lets say i have this main program, it will be the last to be executed only after certain conditions have successfully accomplished.
how am i gonna compile this with one app since you’ve said the webIDE is only capable of flashing and compiles one program. will i make passing and calling to other tabs (files, in just one program) to successfully execute one of them? thanks!
@paolosofio01, can you give me an idea of what your programming skills are?
The Spark runs an environment similar to Ardunio where "multi-tasking’ is implemented by the user. More specifically, several tasks may be run in a cooperative threaded fashion (one after another) and (sometimes) using interrupts for special cases. This is done by having two main code sections: setup(), where all the “run-once” stuff is done and loop() where the continually running stuff (ie “tasks”) are run. Even Spark’s wireless and cloud features are run when loop() ends and prior to starting over. I suggest you get some Arduino programming books to learn how to run multiple tasks within a single-program loop().
I can understand the logic and know how it flows around but minimal in programming. Lets say 6 or 7/10
@paolosofio01, here is an Arduino “multi-tasking” tutorial which may be helpful:
@peekay123 i cant access the link you’d given.
The link works for me, should be okay.