Asynchronous Serial Communication

Overall, I found the labs this week to be a lot of tedium, which is understandable. The exercises were largely a rehash of what we had done in class, but even when everything worked it was really difficult to quickly and efficiently work through them because of the way they are structured. I need to push myself in the future to not get so hung up on documenting every little step and focus on expanding beyond the written instructions for those labs that I feel comfortable with. I also need to push myself with PComp more generally, as I feel like it’s often the first class that gets shoved aside when I’m forced to prioritize and manage my time. I’m hoping that the final project will be an excellent opportunity to do this in a major way.

Instead of an accelerometer, I decided to use an FSR and a potentiometer for the first part of the lab, which really just consisted of changing the arduino code and observing different serial monitor outputs. Since my circuit was set up and working, the serial monitor output followed correctly and as a result there isn’t much to say about this (large) portion of the lab. I’m impressed by how quickly the different pieces can convert between binary, ASCII, and characters, but I shouldn’t be since it’s a computer…

There will be a long, boring video coming eventually that shows a screen capture of most of the screen-based outputs of this lab, as well as some of my work process as well.

The one thing that I did find was that my third value was noise when we started to send multiple values separated by punctuation.¬†When I thought about why, I realized that I didn’t have 3 analog sensors hooked up, and neither did the diagram in the lab. The for loop as written would not work with two analog sensors and one digital. It did work in the next part where it accounts for that and writes each sensor separately.

The next section, on handshaking and call and response, could have potentially been an opportunity to be a bit creative. I wasn’t, however. The output can be seen in the video that will be uploaded.

For the serial input lab, I started out using an FSR. I switched to a potentiometer, however, because I kept running into problems where p5 would return an undefined value even though the serial monitor in arduino printed the correct FSR values. When I replaced the FSR with a potentiometer, this issue cleared up and both programs seemed happy. The graph would have been another opportunity for some creativity, but at this point I was ready to be finished. Again, I need to work on pushing myself. The output for this section of the lab is also on the video.

Leave a Reply

Your email address will not be published.