Posting Data

based on this tutorial

note the limits on a free account below. (these will make more sense later)


2. Once you're logged in, click on the yellow key to get your unique API credentials.

Scroll down to "scripting" to get your username and key


Hint: if you don't see the key, look for the "IO" menu item at the top of the screen. Click on it.

3. Look for line 11 and 12 in your drive's "secrets.py" file. 

Replace "my_adafruit_io.username" with your username and "my_adafruit_io_key"  with your key (both should be between the single quotes) and save the file.

4. While still on your adafruit.io account page, click on Feeds, and create a New Feed








Give your feed a name and a description without spaces or special characters (underscores are OK).

5. While still on your adafruit.io account page, click on Dashboards, and create a New Dashboard






Give your dashboard a name and a description.

6. Open your dashboard and look for the gear icon.  



From the dropdown menu, choose create new block








There are many blocks to choose from, but let's start with a simple line graph.

















You'll be asked to assign a feed to the block. Assign the test feed you made. You don't need to change any parameters right now. Just scroll down and create block. 

7. Here's code that will generate random numbers between 0 and 2000 and post them to your adafruit.io graph block. Every 10 seconds the data should be updating in your adafruit.io graph.


 

8. You need to understand how this code works so you can make alterations and create your own data feeds.


Look at lines 24 through 27. This is where you define your feeds. You need to have a feed name (which can be anything without special characters or spaces). In this case the feed is called "test_feed."  At the end of line 27 you see "/feeds/test " which matches the name of the feed you made in your adafruit.io account. All you need to do is come up with a variable name and then use this line, ending it with the name of the feed you created in your account. So easy! You can have as many feeds as you want (As long as you don't exceed your data limit of 30 points per minute).

 

Challenges: