As this project uses Adafruit IO you'll need to have setup an Adafruit account, then logged in at io.adafruit.com.
If you've never used Adafruit IO before then it would be wise to read these guides:
Feeds
A feed is a store for data points, you can read more about them in the guides linked above, but for now, it's enough to know we need one of them.
We'll use the feed we create to receive our countdown completion message, and then automatically trigger an Action to signify CircuitPython Day.
Go to the IO Feeds page (io.adafruit.com/feeds/) and use the + New Feed button to create a new feed, giving it the name of cpday-countdown
Your new feed will appear in the list of My Feeds, the default group at the top of the feeds page. Clicking its name will take you to the individual feed page, showing all previous data points, and a button to add new data (and download all), along with options for configuring the feed (left sidebar or top menu on small screens).
We'll revisit the cpday-countdown
feed page later, to test our automatically triggered Action, by manually adding data to the feed.
On Adafruit IO there are automatic Actions available. You can set up an action to be triggered by a new feed value, or potentially after a delay, or on a set schedule. Then the Action can perform various processing tasks, followed by an output task like publish to a feed or send an email.
You can read more in this guide to the new Blockly Actions:
We will use the new feed value option, a so-called Reactive Trigger. Start by going to the Actions page and creating a new Action (choose Blockly Action if asked what kind)
Now you're presented with the Blockly Action editor page. Here you can see that I've clicked the blue help triangle (!), so the Root block is listing the current issues.
Trigger:
Select a Reactive block from the Triggers category in the side panel/toolbox. Then select the Feed: option of the reactive trigger block, the first child block, and change the feed block to select the cpday-countdown
feed.
Now change the Operator: block (from any) to equals (=) so the action only runs if the new data sent to our feed exactly matches an expected value.
Lastly, you need to get the String Block from the Values category in the toolbox, it is the one surrounded by speech marks (""). Drag the string block over into the Feed Or Value: section of the Reactive block, directly on top of the last child block placeholder.
Enter the String block by clicking inside and entering the value Launch the snakes!
Action: (Output)
Next the output, for this example you'll send an email, but you could configure anything your mind can come up with. Maybe the countdown could trigger a real space launch of some CircuitPython-powered hardware...Blinka in Space!
Drag the Publish Email block from the Actions category in the toolbox, dropping it next to the Action jigsaw hole causing it to snap into place. Add your custom subject and body to the email, ensuring you get a reminder for CircuitPython Day wherever you are. You can safely ignore the ...using: section of the Email block, it is only for filling in templated placeholders for the email subject and body.
Your finished Blockly Action should look very similar to this:
To test the countdown launch action you need to go to the cpday-countdown
feed page, by navigating to the Feeds page and then clicking on the cpday-countdown
feed name.
Use the Add Data button to add the value Launch the snakes!
You should receive an email nearly instantly, to the primary email address registered on your Adafruit account, reminding you of the snakiest day of the year (or whatever message you intended).
IO Secret Key - Required by settings.toml
To get your IO Key (and username) easily, click the View Key option from the menu on small screens, or use the big yellow Key icon for larger screens, from any IO page. You'll see a CircuitPython-compatible set listed, which you'll copy later into your settings.toml file.
Integrations
There are Power-Ups + Integrations on Adafruit IO, like IFTTT/WeatherKit/Zapier/SMS.
The Time service integration is what we're using in this project to fetch the initial time and account for any time-zone challenges.
See more details at io.adafruit.com/services/time [Must be logged in].
Look up your time-zone from the table linked there, referring to the TZ Identifier column of the table, and make a note of it as it will be used later in the code.
Speaking of code, it's now time to get CircuitPython set up and take a tour of how the different sections of the code work.
Text editor powered by tinymce.