Digital I/O Lab – Week 2 – Graham Widmann

This week in lab, we used what we had made in the last few classes to make a construct that was vastly more complicated involving more enhanced coding techniques and more logical statements to clear up our coding.

DSC_0125_2.JPG

Digital Read and write became our best friends for a while. These functions allowed us to read the status of the button and lights were, while write: gave us the ability to change that status so that we could execute a function.

Since we had multiple lights we had to copy this code a lot so instead we used an array of numbers to represent the lights and turn them all on. Once we understood this it was pretty easy to get other commands we wanted. We just had to adjust the delays of the blinks and the order of delays and commands. This would change the entire ability of the button and the lights. We were told we could NEVER use the delay function again, so things will get interesting from now on.

unfortunately my teammate has the code so, iw was not able to get the best pictures… DSC_0127_2.JPG

Stuttering was an issue for my group at first so we did have to debounce our button. In order to do this we added a delay to our button reads. This allowed us to get accurate readings in our code to use for the digital read. dsc_0126_2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s