USB program SW then send variables OTA on Electron?

Hello,
I am new to the electron and programming. While I have a lot of questions, biggest challenge right now is to understand, if possible, to via USB program that has variables that can be assigned at a later time OTA. For example, hard coded program will tell the electron to drive IO pins high or low at a certain time int he future but these variable times (ExtendTime and RetractTime) will be sent OTA in the future?

Here is an example of my code working but the whole code has to be sent at once. I am trying to limit data usage for each program.

I have a lot of other function that I need to add like radio off and sleep functions but this is my biggest challenge right now. Thanks for all your help.

Have a look :slight_smile:
https://docs.particle.io/reference/firmware/photon/#particle-function-

2 Likes

So If i setup a function called “Extend” then anytime I send an extend command it will execute that function in the code? How do I send an “extend” command OTA without rewriting the code that is already there? Also, can I send an Extend(“10/18/17 1500”) and that variable can be saved in the function?

Have another look :wink:

2 Likes

I understand, Thanks for your help. I am glad you pointed me to a tutorial instead of trying to work through it with me or calling me names. I wrote my code to control the internal LED on the Electron. Heres my code on the Electron:

And then the function popped up in my console where I could pass variables.

Now I am going to work on the Time aspect of the string so I can callout specific times in the future for actuation. again, thanks for your help.

3 Likes