top of page
Writer's pictureassa4664

Digital I/O

Part One

the first part of this lab was making a switch and an LED breakout board that we can use for testing later in the class.


I started with the LED breakout board.

Here is my schematic for that.


It was fairly straightforward. I wanted to use blue LEDs because I could. The only way to do this was to set up the LEDs in parallel. I calculated the resistor I would have needed.

(5V - 3.4V)/.06A = 26 olhms.


We didn't have any of those or 47...or 50... so I used 100.

This is fine, it might dim my LEDs a bit, but it would prevent them from getting too much current.


I then soldered my breakout board. The first time I did it, I accidently switched one of my LEDs so I didn't connect the resistor to the positive side of the LED. I de-soldered and then got it to work that way.


(images: initial solder, re-solder, front)


I then connected the power wire to the 5V on the arduino and the Ground to GND on it as well

and yay! It worked.



Then it was time for

the Switch Breakout Board


This one was going to have three wires come out of it (one for power, ground, and the pin).

I also had to solder this one twice. The first time I connected both the ground and the pin wires to the button instead of just the pin one. This prevented it from working properly. I just de-soldered the ground wire from the button and made it so it was only connected to the resistor. It looks kind of burned when you look close enough.




I then connected them to the arduino and ran code to test the button and the LEDs.

Code to test button


Code to test LED and button




Here is a video of them working:



NeoPixel Fun Times that only kinda sorda worked

For this part we needed to use two switches and to control LEDs and write code to do so.


First I made sure that my Neopixels were soldered and working. I then ran one of the Adafruit library examples worked. I had to solder my neopixel three different times. The second time, my string wire disconnected. The third time time a similar thing happened, but the pad at the bottom got ripped off so I had to get a new one. I soldered it on a new one, accidently connected it to the wrong side, and just cut them off and soldered them to the correct side.


The second step was making sure my two buttons worked. I had them both go through buttonCycler to make sure each was working WITH the neopixel.


It was good.

Then it was time to work with the switches. Here is the set up for that. I took the photos so that I add components just to make it a little easier to read.




However, I was having a lot of issues assigning colors to my neopixel. I understood it was (R,G,B) to values of 255. My neopixel wasn't assigning correctly. I wasn't sure if it was a problem with my code or my circuit so I tried out the other samples provided and modified them to include my buttons. However, I never really understood the problem with my code.



I couldn't figure out the issue with my board. So, I figure the problem was the code, but when I tried to manually enter a value for each one, it wouldn't correspond to the right one or it would change a completely different color. The only ones that turned the correct colors were the first and last one, but the pixel number for the last one didn't coordinate. To test that theory, I used one of the samples and modified it to include my two switches. The values output correctly. I just don't know what I did wrong.


Here is a video of that (TO REITERATE THIS WAS NOT MY CODE FOR THIS ONE, IT WAS A MODIFIED EXAMPLE ). This was strictly for testing purposes. I just wanted to see if it was the board that was acting weird.



11 views0 comments

Recent Posts

See All

Week Ten

Comments


bottom of page