Week11
WEEK 11: buttons but make it networked#
This week and next I made pretty light as I was focusing on final project things. Nonetheless, I did have fun times with various networking things, as I think it is an important skill to have for the future.
GROUP ASSIGNMENT#
A bunch of us CBA folk met and combined our projects, using a mix of wired (UART) and non wired connections to send messages from one to another, eventually succeeding in turning a light on and off and sending simple UART messages:
INDIVIDUAL#
For me, I started by testing a basic UART connection as that is what I would depend on for my final project:
Then I tried a basic wifi test with a Pi Pico W using the following code and it at least succeeded in connecting:
def connect():
#Connect to WLAN
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)
while wlan.isconnected() == False:
print('Waiting for connection...')
sleep(1)
ip = wlan.ifconfig()[0]
print(f'Connected on {ip}')
(Code via RaspPi organization)
Next came time to mill the board that would use a UART connection in conjuction with my input device buttons for my final project.
Milling it took a few tries because it was quite big and the traces didn’t cut deep enough due to bowing. I also had to iterate on the design a little, using 0 Ohm resistors to jump over some traces. I also killed a board or two by gunking up too much solder on some of the pins, thus making it impossible to plug in my buttons (which have three pins each due to having LEDs inside of them). I also had an issue getting the Carvera to cut holes correctly, with initially them being too small and sometimes being ignored by the software which was confusing.
Soldering in the end wasn’t too terrible as I am slowly improving. I then hooked up my Pi Pico and the Raspberry Pi I was using and the UART connection worked, sending the message that a button was pressed! (lets gooo)
A FEW QUESTIONS I WAS WONDERING THAT I GOT ANSWERS TO#
Q: What's a MAC address?
A: an address that's assigned to a device on a network! A MAC address is a bit more local than an IP in that it isn't used outside of the network the thing is on. Someone on [Reddit](https://www.reddit.com/r/explainlikeimfive/comments/v3uyoa/eli5_difference_between_mac_and_ip_address/) (the divine source of truth) compared the two by saying that an IP is like a phone number - easily accessible, used for communication, but a MAC is like a social security number, a bit more private and local. A MAC address usually stays the same too unlike IPs which can change.