week 10

networking and communications.

Note: this work was done starting August 2022.

For this week, I wanted my previously created microphone board to communicate with my servo board. In particular, when I clapped, I wanted my microphone board to send the message to my servo board which would cause it to move. First I correctly wired the tx on my microphone board to the rx on my servo board. Here is that setup:

Now I could start coding! I wrote two simple programs, one for my microphone board and one for my servo board. For the microphone board I made use of Serial1 (which reads and writes to the tx and rx pins). Then when the value of the microphone went over a certain threshhold, I had the program write to the tx pin. On the other hand, for the servo board, I had it continually read the rx pin. Then when it read the correct message, the program would correspondingly move the servo arm. The first picture shows the servo board correctly getting the message from the microphone board when I clapped. As we can see, the message is "mic detected." The second picture shows the full setup with the servo.

Here is everything working together:

Finally, here is the code: Microphone Code Servo Code