User Tools

Site Tools


haas:fall2020:common:projects:clr2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:fall2020:common:projects:clr2 [2020/10/10 16:38] – [Program] wedgehaas:fall2020:common:projects:clr2 [2020/11/04 12:51] (current) – [Wiring up our circuit] wedge
Line 128: Line 128:
  
 So, your ultimate circuit will have FOUR independent inputs- red control, green control, and blue control (all buttons), and then the DIRECTION switch (increase/decrease). FOUR GPIOs in INPUT mode are needed. So, your ultimate circuit will have FOUR independent inputs- red control, green control, and blue control (all buttons), and then the DIRECTION switch (increase/decrease). FOUR GPIOs in INPUT mode are needed.
 +
 +====Final result====
 +Once all connected, your circuit should allow for directional, per-colour adjustment of each of the three colours. Here's an animated gif of one such circuit in action:
 +
 +{{ :haas:fall2020:common:projects:clr2_working_example.gif |}}
 =====Program===== =====Program=====
 Your program to implement for this project involves using the wired up RGB LED, the three buttons, and the switch, to do the following: Your program to implement for this project involves using the wired up RGB LED, the three buttons, and the switch, to do the following:
Line 146: Line 151:
 When done and ready to submit, on lab46: **make submit** When done and ready to submit, on lab46: **make submit**
  
 +=====Strategy=====
 +In general, you will want your completed program to perform in the manner described as follows (in English-like pseudocode):
 +
 +<code>
 +LOOP TO KEEP PROGRAM GOING
 +
 +        IF SWITCH IS IN POSITION 1:
 +                DIR <- +10
 +        ELSE
 +                DIR <- -10
 +        END IF
 +
 +        IF RED BUTTON IS PRESSED:
 +                REDCOLOR <- REDCOLOR + DIR
 +        END IF
 +
 +        IF GREEN BUTTON IS PRESSED:
 +                GREENCOLOR <- GREENCOLOR + DIR
 +        END IF
 +
 +        IF BLUE BUTTON IS PRESSED:
 +                BLUECOLOR <- BLUECOLOR + DIR
 +        END IF
 +
 +        SETRED(REDCOLOR)
 +        SETGREEN(GREENCOLOR)
 +        SETBLUE(BLUECOLOR)
 +
 +        DELAY
 +
 +END LOOP
 +</code>
 =====Submission===== =====Submission=====
 To successfully complete this project, the following criteria must be met: To successfully complete this project, the following criteria must be met:
Line 175: Line 212:
 <code> <code>
 91:clr2:final tally of results (91/91) 91:clr2:final tally of results (91/91)
-*:clr2:post picture of program-powered LED in layout to #desig [13/13] +*:clr2:post picture of unpowered layout to #desig and get approval [13/13] 
 +*:clr2:post picture to #desig by Sunday before deadline [13/13] 
 +*:clr2:post picture of powered layout to #desig [13/13] 
 *:clr2:grabit on the code on lab46 by Sunday before deadline [13/13] *:clr2:grabit on the code on lab46 by Sunday before deadline [13/13]
 *:clr2:clr2.c code adequately modified per project requirements [26/26] *:clr2:clr2.c code adequately modified per project requirements [26/26]
-*:clr2:colors are appropriately reset prior to each section [13/13] 
-*:clr2:color levels adjust in offsets of 10, with useful delays [13/13] 
 *:clr2:updated code is pushed to lab46 repository [13/13] *:clr2:updated code is pushed to lab46 repository [13/13]
 </code> </code>
haas/fall2020/common/projects/clr2.1602347898.txt.gz · Last modified: 2020/10/10 16:38 by wedge