This week I worked on connecting my Huzzah and Metro M0 Express boards using a wired connection in order to control a TFT board using a WiFi connection!
Here’s the final product:
I went through a few tutorials to do this. I would recommend checking out and understanding these links if you want to replicate my project for this week:
This tutorial shows that it is pretty simple to make two boards communicate with one another. It did take me a little longer than expected though, as I was trying to figure out the best way to connect the boards, how to make sure they shared the same ground, and how to power both boards.
Here is how I decided to connect my boards:
Working from the same link, I was able to write code for the transmitting board (Huzzah) and the receiving board (Metro) based on the pins I came up with and previously working with the TFT display board, a Huzzah, and the remote Firebase server. I decided to use the same server that I created in class used to control an LED remotely, except now when the LED turns on, I also want to turn on the TFT display as well.
Code for the transmitting board (Huzzah):
Code for the receiving board (Metro):
I used a hotspot on my iPhone in order to connect to the remote server, so you can input any home or public WiFi or hotspot that your computer or device is also connected to as the WIFI_SSID and WIFI_PASSWORD input. See this Firebase tutorial for more information on obtaining your FIREBASE_HOST and FIREBASE_AUTH names.
Access my remote server here! Now when my Huzzah, Metro, LED and TFT display are all powered and connected to my iPhone's hotspot, you will be able to control my devices from anywhere using the remote server!
The inspiration for this project was to be able to have someone write
words over the remote server to print on the board, but since
I was dealing with digitalRead()
and digitalWrite()
functions
with only deal with HIGH and LOW inputs and outputs, I was not
able to explore how to get past this binary constraint this week.
However, it would be really cool to keep working more with these
devices in the future to eventually allow someone to print words
on the display remotely! Another idea could be for someone to
enter a number on the remote server, and the LED could flash
that many times while the display prints the number.