This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2020:common:projects:clr2 [2020/10/10 16:35] – [Wiring up our circuit] wedge | haas: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/ | So, your ultimate circuit will have FOUR independent inputs- red control, green control, and blue control (all buttons), and then the DIRECTION switch (increase/ | ||
+ | |||
+ | ====Final result==== | ||
+ | Once all connected, your circuit should allow for directional, | ||
+ | |||
+ | {{ : | ||
=====Program===== | =====Program===== | ||
- | It is your task to obtain, study, and complete a program (clr2.c) that is to explore and display | + | Your program |
+ | * switch control direction of adjustment (increasing in value or decreasing in value) | ||
+ | * each button allows you to adjust the value of a particular colour component of the RGB LED. It is recommended that you use the button caps of the respective colour (put the red cap on the red adjustment button, for instance) | ||
+ | * display the current RGB values on the RGB LED. | ||
+ | * please have some sort of minimal delay in your program... no shorter than 100mS | ||
=====Compiling===== | =====Compiling===== | ||
Since the grabit brought in a Makefile, you can compile your code simply by typing: **make** | Since the grabit brought in a Makefile, you can compile your code simply by typing: **make** | ||
Line 142: | 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): | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | </ | ||
=====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 171: | Line 212: | ||
< | < | ||
91: | 91: | ||
- | *:clr2:post picture of program-powered | + | *: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/ | ||
*: | *: | ||
*: | *: | ||
- | *: | ||
- | *: | ||
*: | *: | ||
</ | </ |