This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
user:jparrish:start [2023/12/15 04:16] – [SECTION 2: WRITING C CODE] jparrish | user:jparrish:start [2023/12/15 04:40] (current) – jparrish | ||
---|---|---|---|
Line 29: | Line 29: | ||
*hg pull - pulls the files pushed into the repository | *hg pull - pulls the files pushed into the repository | ||
*hg update - updates the systems current repository to match the one pulled | *hg update - updates the systems current repository to match the one pulled | ||
+ | to turn in a project, you must first push it to lab46, then within lab46, run the submit command. | ||
==== SECTION 2: WRITING C CODE ==== | ==== SECTION 2: WRITING C CODE ==== | ||
In this section, we will be going over the basics of writing, troubleshooting, | In this section, we will be going over the basics of writing, troubleshooting, | ||
Line 118: | Line 119: | ||
\\ | \\ | ||
==== SECTION 3: HARDWARE AND WIRINGPI ==== | ==== SECTION 3: HARDWARE AND WIRINGPI ==== | ||
- | ==== SECTION 4: PUZZLES ==== | + | Hardware is the most used part of this class, where we typically use LEDS and Wiring pi.\\ |
+ | with wiring pi installed by doing \\ | ||
+ | < | ||
+ | then | ||
+ | sudo dpkg -i wiringpi-latest.deb </ | ||
+ | with wiring pi now installed, we can do some basic things\\ | ||
+ | typing gpio readall into the terminal will spit back the state of all the pins on the gpio board \\ | ||
+ | {{ : | ||
+ | typing gpio write (wpi number) 1 will change the state of the selected pin to 1 or HIGH, type 0 for LOW \\ | ||
+ | gpio mode (wpi number) out will change the pin to output mode, typing in instead will put it into input mode\\ | ||
+ | for any project, youll need the wiringPi library included in your code to make use of wiringPi\\ | ||
+ | \\ | ||
+ | \\ | ||
+ | Within your code, you can use digitalWrite and digitalRead to change the state or read the state of a pin, which is useful for turning an led on and off or checking to see if a button is pressed\\ | ||
+ | < | ||
+ | digitalRead(pin) | ||
+ | </ | ||
+ | if we include softPwm into our libraries, we can also change how much voltage is sent through the pin, instead of High or Low | ||
+ | < | ||
+ | softpwmWrite(pin, | ||
+ | </ | ||
+ | this is useful to make an led breathe or to get different colors in an RGB led\\ | ||
+ | for components, there are far to many to list and explain how they must be wired, instead, one can refer to the wiringPi spreadsheet, | ||
+ | [[https:// | ||
==== SECTION 5: SPREADSHEETS AND TEXT BASED TASKS ==== | ==== SECTION 5: SPREADSHEETS AND TEXT BASED TASKS ==== | ||
+ | This section will show how to install the spreadsheet program and basic functions\\ | ||
+ | firstly, install sc by runnning | ||
+ | < | ||
+ | once sc is installed, you can open files by doing sc (filename)\\ | ||
+ | within sc, there are tons of functions and commands that can be looked upin the terminal with < | ||
+ | But, for the purposes we are using it for, there are only a handful that you should really know \\ | ||
+ | |Q | quit the program | | ||
+ | |= | enter a number that you can use for cell calculation (D4 - D5) | | ||
+ | |/<,> | enter a string center aligned ,left, or right aligned | | ||
+ | |@sum| add all in specified range | | ||
+ | within the course, sc is mainly used for gfo.\\ | ||
+ | |||
+ | |||
- | ==== CLOSING NOTES ==== | ||