Arduino IDE X Adafruit - Connect Met Een Klasgenoot
by S00F in Craft > Digital Graphics
102 Views, 0 Favorites, 0 Comments
Arduino IDE X Adafruit - Connect Met Een Klasgenoot
Name: Sophie Bouman & Isabel Erven
Date: 12/10/2022
In this manual I tried to make 2 arduino's connect with a push button.
Supplies
- Arduino IDE 2x
- Push button
- Adafruit account 2x
Start Adafruitio_06_digital.in
I already used Adafruit before, if you didn't, you need to install an account first.
Create a new feed in Adafruit IO (https://io.adafruit.com/)
In Arduino you go to: examples > adafruit io > Adafruitio_06_digital.in
Add the button to the Arduino board (Red to 3.3, Black to gnd, yellow to D0)
We changed BUTTON_PIN D5 to BUTTON_PIN D0
We filled in the WiFi information and the writers adafruit name and key
We went to the website of Adafruit > Adafruit IO > feed > kussiekussielove (This is the name of our feed)
🚩 We added all the code and it connected to the wifi and the adafruit, but nothing happend when we pressed the button.
Wrong Example Code
We used Arduino example 07, but we needed to use 20 (for the one with the button) and 21 (The one without the button).
So the one with the button went to:
examples > adafruit io > Adafruitio_20_shared_feed_write
Here we only had to add:
In Adafruitio_20_shared_feed_write.ino:
- #define BUTTON_PIN D5
- #define FEED_OWNER "***********"
- AdafruitIO_Feed *sharedFeed = io.feed("****FEED NAME****", FEED_OWNER);
In config.h:
- #define IO_USERNAME "***************"
- #define IO_KEY "*********************"
- #define WIFI_SSID "*******************"
- #define WIFI_PASS "****************"
And the one without the button went to:
examples > adafruit io > Adafruitio_21_feed_read
In Adafruitio_21_feed_read:
- #define FEED_OWNER "***********"
- AdafruitIO_Feed *sharedFeed = io.feed("****FEED NAME****", FEED_OWNER);
In config.h:
- #define IO_USERNAME "***************"
- #define IO_KEY "*********************"
- #define WIFI_SSID "*******************"
- #define WIFI_PASS "****************"
🚩 Small Mistakes
- We found out that we didn't connect the right port with the one without the button, so it was easily fixed.
- We had another problem, the Adafruit was connecting, however nothing happend once again when we pressed the button. We found out that we didn't fill in the right user name.
AFTER THAT IT WORKED!