Difference between revisions of "How it's made 2223"
Jump to navigation
Jump to search
Line 38: | Line 38: | ||
digitalWrite(ledPin,LOW); //turns pin 13 off | digitalWrite(ledPin,LOW); //turns pin 13 off | ||
delay(500); //stops the loop for 500 milliseconds | delay(500); //stops the loop for 500 milliseconds | ||
+ | } | ||
+ | </pre> | ||
+ | ==== Traffic light example ==== | ||
+ | [[File:Led-traffic-light bb.png|thumb|center]] | ||
+ | <pre> | ||
+ | int RedLedPin = 13; //the int RedLedPin is 13 | ||
+ | int GreenLedPin = 12; //the int GreenLedPin is 12 | ||
+ | |||
+ | void setup() { | ||
+ | pinMode(RedLedPin,OUTPUT); //ledPin is a OUTPUT | ||
+ | pinMode(GreenLedPin,OUTPUT); //ledPin is a OUTPUT | ||
+ | |||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | digitalWrite(GreenLedPin,HIGH); //turns green led on | ||
+ | delay(5000); //stops the loop for 5000 milliseconds | ||
+ | for(int i = 0; i < 5; i++){ //this for loop gets 5 times repeated | ||
+ | digitalWrite(GreenLedPin,LOW); //turns green led off | ||
+ | delay(500); //stops the loop for 500 milliseconds | ||
+ | digitalWrite(GreenLedPin,HIGH); //turns green led off | ||
+ | delay(500); //stops the loop for 500 milliseconds | ||
+ | } | ||
+ | digitalWrite(GreenLedPin,LOW); //turns green led off | ||
+ | digitalWrite(RedLedPin,HIGH); //turns red led on | ||
+ | delay(5000); //stops the loop for 5000 milliseconds | ||
+ | digitalWrite(RedLedPin,LOW); //turns red led on | ||
} | } | ||
</pre> | </pre> |
Revision as of 08:44, 15 September 2022
__ __ _ __ _ __ / / / /___ _ __ (_) /( )_____ ____ ___ ____ _____/ /__ / /_/ / __ \ | /| / / / / __/// ___/ / __ `__ \/ __ `/ __ / _ \ / __ / /_/ / |/ |/ / / / /_ (__ ) / / / / / / /_/ / /_/ / __/ /_/ /_/\____/|__/|__/ /_/\__/ /____/ /_/ /_/ /_/\__,_/\__,_/\___/
2022-09-08
- WH.02.125 (Prototyping Space IAS) 9:00 - 16:00
Introduction or "Hello World"
1. Circuit bending
2. Introduction Arduino
Hello World!
void setup() { } void loop() { Serial.println("Hello World!"); //sends a message to the computer }
Simple Led blink example
int ledPin = 13; //the int ledPin is 13 void setup() { pinMode(ledPin,OUTPUT); //ledPin is a OUTPUT } void loop() { digitalWrite(ledPin,HIGH); //turns pin 13 on delay(500); //stops the loop for 500 milliseconds digitalWrite(ledPin,LOW); //turns pin 13 off delay(500); //stops the loop for 500 milliseconds }
Traffic light example
int RedLedPin = 13; //the int RedLedPin is 13 int GreenLedPin = 12; //the int GreenLedPin is 12 void setup() { pinMode(RedLedPin,OUTPUT); //ledPin is a OUTPUT pinMode(GreenLedPin,OUTPUT); //ledPin is a OUTPUT } void loop() { digitalWrite(GreenLedPin,HIGH); //turns green led on delay(5000); //stops the loop for 5000 milliseconds for(int i = 0; i < 5; i++){ //this for loop gets 5 times repeated digitalWrite(GreenLedPin,LOW); //turns green led off delay(500); //stops the loop for 500 milliseconds digitalWrite(GreenLedPin,HIGH); //turns green led off delay(500); //stops the loop for 500 milliseconds } digitalWrite(GreenLedPin,LOW); //turns green led off digitalWrite(RedLedPin,HIGH); //turns red led on delay(5000); //stops the loop for 5000 milliseconds digitalWrite(RedLedPin,LOW); //turns red led on }
2022-09-15
- WH.02.125 (Prototyping Space IAS) 9:00 - 16:00
Example 1
2022-09-22
- WH.02.110 (Instruction Room IAS) 9:00 - 16:00
Drawing machine and mechanical musicinstrumments
- tinguely metamatics - drawing machine
- working with servos
- working with sensors
- bells
2022-09-29
- WH.02.110 (Instruction Room IAS) 9:00 - 16:00
Theremin
2022-10-06
- WH.02.110 (Instruction Room IAS) 9:00 - 16:00
Heartbeat controlling light
2022-10-13
- WH.02.110 (Instruction Room IAS) 9:00 - 16:00