Arduino IDE X Adafruit - Connect Met Een Klasgenoot

by S00F in Craft > Digital Graphics

95 Views, 0 Favorites, 0 Comments

Arduino IDE X Adafruit - Connect Met Een Klasgenoot

daniel-andrade-0IZC2kYhYIo-unsplash.jpg

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

Schermafbeelding 2022-10-12 om 13.36.54.png

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

Schermafbeelding 2022-10-12 om 13.37.54.png

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

WhatsApp Image 2022-10-12 at 1.11.29 PM.jpeg
WhatsApp Image 2022-10-12 at 1.18.27 PM.jpeg
Schermafbeelding 2022-10-12 om 13.42.32.png
  • 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!