Message Boards Message Boards

IoT: Controlling an RGB LED with the Wolfram Cloud, GPIO pins

Posted 9 years ago
POSTED BY: Armeen Mahdian
3 Replies

Very nice little project! Thanks for sharing.

The while loop causes for many many 'grabs' from the cloud... Perhaps schedule something that fetched the cloud every x seconds to not overload the cloud servers?

POSTED BY: Sander Huisman
Posted 9 years ago

Thanks for your suggestion, did you have something like the following in mind?

oldInput = {};
While[True,
 userInput = Normal[CloudGet[CloudObject[$formURL]]];
 If[oldInput =!= userInput,
  Replace[userInput,
   HoldPattern[tag_ -> value_] :> outputDigital[tag, value], 1]];
 oldInput = userInput
 Pause[5]
 ]

Or instead using something more elegant such as ScheduledTask? Of course, this makes a miniscule delay between the time that the form is submitted and when the LED color is changed.

POSTED BY: Armeen Mahdian

enter image description here - you earned "Featured Contributor" badge, congratulations !

Dear @Armeen Mahdian, this is a great post and it has been selected for the curated Staff Picks group. Your profile is now distinguished by a "Featured Contributor" badge and displayed on the "Featured Contributor" board.

POSTED BY: Vitaliy Kaurov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract