Project: unit2.2

Homework 3

Arduino makes me feel desperate. :( O.M.G. He.....lp......Me....... Although the code I wrote was right, it still didn't work. TAT. Mr. Arduino Mr. Arduino!! Please tell me which part I made mistake.   Anyway, I used the MPR121 and firstly wanna touch certain thresholds to trigger the Servo Motor. For testing, I only turn on one threshold and use LED to replace the Motor. I get the code online and use Switch-Case to program. If the threshold is touched, the LED will turn on. Now, the problem is I wrote Serial.print within the Switch-Case and it could print "Kai" when I touched. But the LED can't illuminate. More

Arduino Practice

This is a practice which combines the button and potentiometer. Actually, I also tried to combine the button function and LED fading but it failed. When I turned on the LED, it could illuminate with fading. However, I couldn’t turn it off….lol   Code: #define ledPin 13 #define buttonPin 7 #define potPin A0 boolean ledState = LOW; boolean prevBtnState = LOW; void setup() { pinMode( ledPin, OUTPUT ); pinMode( buttonPin, INPUT ); pinMode( potPin, INPUT); } void loop() { boolean btnState = digitalRead( buttonPin… More

🙄Blink Bling Bling🙄

Code: void setup() { pinMode( 13,OUTPUT); digitalWrite( 13, LOW ); delay(3000); digitalWrite( 13, HIGH ); delay(220); digitalWrite( 13, LOW ); delay(30); digitalWrite( 13, HIGH ); delay(220); digitalWrite( 13, LOW ); delay(30); digitalWrite( 13, HIGH ); delay(220); digitalWrite( 13, LOW ); delay(30); } void loop() { digitalWrite( 13, HIGH ); delay(665); digitalWrite( 13, LOW ); delay(35); digitalWrite( 13, HIGH ); delay(395); digitalWrite( 13, LOW ); delay(35); digitalWrite( 13, HIGH ); delay(196); digitalWrite( 13, LOW );… More