Changes

Jump to: navigation, search

Week 2 Lab

670 bytes added, 15:59, 7 April 2009
Changing the Pattern
# Connect your switch circuit to on if the digital I/O pins, and change <code>inputPin</code> in the button program to this number. (Mine is Pin 7)
=== Changing the Pattern Behavior ===
* In the simple blink exampe, this code here:
<code>
delay(1000); // waits for a second
</code>
* is what creates the behavior: half the time on, half the time off. * You could insert your own code, for instance<code> digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for one second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for one second digitalWrite(ledPin, HIGH); // sets the LED on delay(500); // waits for half a second second digitalWrite(ledPin, LOW); // sets the timingLED off delay(1000); // waits for one second</code>* to get a "long-short-long-short" blinking. ** Try this out. *Try some other variants...do you know For loops or Arrays?
=== Loop (Optional) ===

Navigation menu