
<p> Name: Period: Date: E-Textiles 1A Assignment 7A –- Part I: Mural Program Storyboard – two switches</p><p>Objectives: In this activity you will: ● Use a switch as input ● Program their own computational circuit using conditionals ● Write functions to organize and reuse code.</p><p>To turn in your completed answer document: 1. Named your document #-ECS-Asign7A-Part I– MuralProgramStoryboard-Last,First where # is your period. 2. Upload your file to Mr. Gonzalez Textiles’ DropItTo.me (https://dropitto.me/MrGonzalezTextiles )</p><p>3. Use the password etextiles</p><p>Mural Program Storyboard: Let’s write the program for the Circuit Playground on your mural piece. 1. NAMING SECTION: Declare the variables for your components. Use descriptive names so you know what is what when you are writing the rest of your program: </p><p> a. for the 4- led lights, which in this case can be name: your led1, led2, led3 & led4. b. for the switches, switch # 4, switch # 19 and/or switch # 21, in your Circuit Playground can be named switch1, switch2 and/or switch3 /*Unlike pinMode(INPUT), there is no pull-down resistor necessary. An internal 20K-ohm resistor is pulled to 5V. This configuration causes the input to read HIGH when the switch is open, and LOW when it is closed.</p><p>In other words, when the switch is 'on' (closed/connected), it will read as LOW. If the switch is 'off' (open/disconnected), it will read as HIGH.</p><p>*/</p><p>/* NAMING SECTION # 1: We name things (lights and switches) to keep track of them easily. What will you name your other lights? */ int ON = HIGH; //This is to make coding for the switch "on" or "off" easier int = ; // These are the names of your lights, and the number of the pin you will connect to. int = ; // We named each led to make it easier to code int = ; int = ;</p><p> int = ; //These are the names and numbers of the switches you are using int = ; 2. SETUP SECTION: In the setup() function, initialize your LED’s and Switches you declared in the naming section.. </p><p>Since lights are output, and Switches are input,</p><p>/*SETUP SECTION #2: Put things here that you only need to do once: For instance, OUTPUTS AND INPUTS (lights, switches, . . . ). void setup() // start serial connection This is for the Circuit { Playground to work properly. Serial.begin(9600); // Here we tell the Circuit Playground to read the switches as INPUT pinMode( , ); pinMode( , ); // Here we tell the Circuit Playground to read the lights as OUTPUT pinMode( , ); pinMode( , ); pinMode( , ); pinMode( , ); } 3. Describe your 4 light patterns (in words, what are they going to look like?):</p><p>Pattern # 1: (Describe in words your pattern, what is it going to do or look like)</p><p>Pattern # 2: (Describe in words your pattern, what is it going to do or look like)</p><p>Pattern # 3: (Describe in words your pattern, what is it going to do or look like)</p><p>Pattern # 4: (Describe in words your pattern, what is it going to do or look like) BUILDING BLOCKS SECTION: 4. Write the functions (the code pattern) for your different light patterns from #3, one in each box:</p><p>Pattern # 1: (The code that you will be using for this pattern)</p><p>Void () // here we need to give a name { to the functions. For example: BlinkingPattern1, } or even heart bit, . . . Remember: LOW is OFF, HIGH is ON delay (1000) is to wait 1 second</p><p>Pattern # 2: (The code that you will be using for this pattern)</p><p>Void () // here we need to give a name { to the functions. For example: BlinkingPattern1, } or even heart bit, . . . Remember: LOW is OFF, HIGH is ON delay (1000) is to wait 1 second Pattern # 3: (The code that you will be using for this pattern)</p><p>Void () // here we need to give a name { to the functions. For example: BlinkingPattern1, } or even heart bit, . . . Remember: LOW is OFF, HIGH is ON delay (1000) is to wait 1 second</p><p>Pattern # 4: (The code that you will be using for this pattern)</p><p>Void () // here we need to give a name { to the functions. For example: BlinkingPattern1, } or even heart bit, . . . Remember: LOW is OFF, HIGH is ON delay (1000) is to wait 1 second 5. Using the different possible combinations of the two switches. Describe which pattern will run based on the positions of the switches:</p><p>Position of the two switches # 1: </p><p>Which pattern will you use here: (just mention the name of pattern you will use here)</p><p>Position of the two switches # 2: </p><p>Which pattern will you use here: (just mention the name of pattern you will use here)</p><p>Position of the two switches # 3: </p><p>Which pattern will you use here: (just mention the name of pattern you will use here)</p><p>Position of the two switches # 4: </p><p>Which pattern will you use here: (just mention the name of pattern you will use here)</p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-