WEEK 9 Unusual Switch + Documentation blog post Shereena AlNuaimi

I spent hours trying to think of a concept until it eventually occurred to me. To be very honest, I’m happy with the result, but I wanted to challenge myself further and attempt to learn more about Arduino. My original plan was not to blow a charm into the jumper cable to achieve the light produced by the LED, but since my code was crashing and my Arduino board stopped working all of a sudden, I had to modify my plan. I had to make the most of my limited time to do my task.

Naturally, investing a significant amount of time to complete this “unusual switch” project enabled me to become comfortable with the Arduino board concept overall. While this wasn’t how I intended to become familiar with it, the experience was still an eventful rollercoaster. Moreover, I decided to incorporate a very memorable part of my childhood a charm of the Arc De Triomphe. France was a huge part of my childhood and still is, something that everyone finds shocking is that my first language surprisingly was French (I know crazy right?). Furthermore, I wanted to combine a partial part of my life into this project as well.

Something I’d like to improve on in the future is trying to figure out why the brightness of my LED was so dim and not that bright. Overall, I’m pleased with the outcome, and the fact that I get to include something somewhat special was pleasing.

Unusual switch

const int led0 = 11; // LED connected to digital pin 11
const int touchSensorPin = 3; // Touch sensor (white wire) connected to digital pin 3

void setup() {
  pinMode(led0, OUTPUT); //LED as output
  pinMode(touchSensorPin, INPUT_PULLUP);
}

void loop() {
  if (digitalRead(touchSensorPin) == LOW) {  // if touch sensor detects physical contact
    digitalWrite(led0, HIGH); // Turn on LED
  } else {
    digitalWrite(led0, LOW); // Turn off LED
  }
}

 

 

Leave a Reply