User:ZUZU/SI 22: Difference between revisions

From XPUB & Lens-Based wiki
Line 12: Line 12:


use loop to make mini traffic lights:
use loop to make mini traffic lights:
[[File:Traffic_lights.mp4|200px|thumb|left|Caption]]
   int greenLed = 13;
   int greenLed = 13;
   int yellowLed = 12;
   int yellowLed = 12;
Line 36: Line 37:
     digitalWrite(11,LOW);
     digitalWrite(11,LOW);
   }
   }


== WEEK 9 ==
== WEEK 9 ==

Revision as of 02:56, 13 November 2023

I used to use Apple pages to keep a record of what I learned, but they were always a bit of a mess, so I'm going to start using a Wiki. hopefully, it will help me improve the situation.

WEEK 8

Friday 10 November

Use Arduino to control LED lights

use loop to make mini traffic lights: File:Traffic lights.mp4

 int greenLed = 13;
 int yellowLed = 12;
 int redLed = 11;
 void setup() {
   // put your setup code here, to run once:
   pinMode(13, OUTPUT); //green 
   pinMode(12, OUTPUT); //yellow
   pinMode(11,OUTPUT); // red
 }
 void loop() {
   // put your main code here, to run repeatedly:
   //turn green light on for 0.5 seconds
   digitalWrite(13,HIGH);
   delay(500);
   //turn off green light and turn yellow light on for 0.5 second
   digitalWrite(13,LOW);
   digitalWrite(12,HIGH);
   delay(500);
   // turn yellow off anf turn red on for 0.5 seconds
   digitalWrite(12,LOW);
   digitalWrite(11,HIGH);
   delay(500);
   digitalWrite(11,LOW);
 }

WEEK 9

Monday 13 November

Worm Picnic