Zarmond's Rubber Ducky (DuckDuino, if you will)
Zarmond's Rubber Ducky (DuckDuino, if you will)
What I wanted to learn, and why it interested me: [Your text goes here. Should be a short description of what you wanted to learn and why you chose it. A couple of sentences.]
Final outcome: [Your text goes here. Should be a short description of where you got to in your final build. A couple of sentences.]
Images of final creative/exploratory output
[Final image or video. Your image caption goes here. Remember to add alt text if needed.]
[Final image or video. Your image caption goes here. Remember to add alt text if needed.]
Process images from development towards creative/exploratory output
[Process image or video. Your image caption goes here. Remember to add alt text if needed.]
[Process image or video. Your image caption goes here. Remember to add alt text if needed.]
Process and reflection:
[Your text goes here; at least 150 words. Address what your process was, e.g. what did you make/do first; how did it go; what did you make/do next; etc.
Include a reflection at a minimum addressing what you learned, any surprises along the way, and how you feel about where you ended up.]
Technical details
[Electrical schematic. Add a brief caption for clarity; this could be as simple as "Electrical schematic" but you can also use the space to describe anything that would be useful for your reader, e.g. "The 12V power came from a LiPo battery, not drawn."]
/*
60-223 Intro to Physical Computing, fall 2025
Domain-specific Skill Building exercise: [Insert name of your project here]
[Write a short description of what this sketch does. What hardware does
it connect to? What is its function? Imagine you're describing it to someone
over the telephone.]
Pin mapping:
Arduino pin | role | details
------------------------------
5 input momentary button
8 output external LED
Released to the public domain by the author, January 2024
Robert Zacharias, rzachari@andrew.cmu.edu
*/
const int BUTTON_PIN = 5;
const int LED_PIN = 8;
void setup() {
pinMode(BUTTON_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
int buttonState = 0;
buttonState = digitalRead(BUTTON_PIN);
int ledBrightness = 0;
if (buttonState == HIGH) { // if the button was pressed
ledBrightness = 200; // bright
}
else if (buttonState == LOW) { // otherwise, if the button wasn't pressed
ledBrightness = 30; // dim
}
analogWrite(LED_PIN, ledBrightness);
Serial.print("buttonState = "); // just write that text to the screen
Serial.print(buttonState); // then send the value of the variable
Serial.print(", ledBrightness = "); // write that text to the screen
Serial.println(ledBrightness); // send the value of the variable
delay(10);
}