Betsy McIver – Assignment 3

I made my switch out of a clip that normally lives on the fridge

Switch Counter – counts the number of times one button is pushed followed by the second button being pushed (while the first one is still pushed).  The LED blinks to indicate the total number of times they have been pushed.

Arduino Sketch: Switch_Counter

People Counter – Counts the number of people in a room.  When one button is pushed, it adds a person in the room. When the other button is pushed, it subtracts a person who has left the room. Any time either switch is pushed, the LED blinks to indicate the number of people in the room.

Arduino Sketch: People_Counter

Advertisements

1 comment so far

  1. mdgross on

    This is a candidate for simplification:

    if (valA == LOW) {
    if (valB == LOW) {

    Could become:
    if ((valA == LOW) && (valB n== LOW)) {


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

%d bloggers like this: