User Tools

Site Tools


user:nbutler5:start

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
user:nbutler5:start [2023/12/14 01:14] nbutler5user:nbutler5:start [2023/12/15 03:27] (current) nbutler5
Line 5: Line 5:
 **PCTX -** **PCTX -**
  
-PRACTICING CRITICAL THINKING projects were weekly projects, but required bi-weekly the other were bonus points.+PRACTICING CRITICAL THINKING projects were weekly projects, but required bi-weekly the others were bonus points.
  
 The objective of the project was to use logic and reasoning to get answers, which is critical to becoming a good coder. The logic puzzles were long division of letters with specific bases (10, 11, 12, etc.) and with the knowledge of calculating a quotient with real number we translate that to the letter long division, but add logic to accomplish the puzzle. Base 10 are values 0,1,2,3,4,5,6,7,8,9 and each numerical value would be associated with a letter at the end of the puzzle once you've solved it.  The objective of the project was to use logic and reasoning to get answers, which is critical to becoming a good coder. The logic puzzles were long division of letters with specific bases (10, 11, 12, etc.) and with the knowledge of calculating a quotient with real number we translate that to the letter long division, but add logic to accomplish the puzzle. Base 10 are values 0,1,2,3,4,5,6,7,8,9 and each numerical value would be associated with a letter at the end of the puzzle once you've solved it. 
Line 113: Line 113:
 orange = gdImageColorAllocate (image, 0x00, 0x00, 0x00); orange = gdImageColorAllocate (image, 0x00, 0x00, 0x00);
  
-The other side of this project is to generate shapes and tie the colors you have made to the shapes the shapes you can create can be made with functions from the library gd.h and link for functions: +The other side of this project is to generate shapes and tie the colors you have made to the shapes. The shapes you can create can be made with functions from the library gd.h
-https://libgd.github.io/manuals/2.3.0/index/Functions.html+ 
 +link for functions: https://libgd.github.io/manuals/2.3.0/index/Functions.html
  
 ------------------------------------------------------------- -------------------------------------------------------------
Line 148: Line 149:
  
 **STLX -** **STLX -**
 +
 +STL0: Blink LED light every 1 second
 +
 +This is the first project where we get familiar with the wiring of the cobbler on the breadboard of the electronics kit and how to understand the cobbler to implement code properly. You also have to use the wiringPi.h library to use all of the Pi functions, and to initialize the functionality of the wiringPi library you must have a if statement in your code for the wiringPiSetup function. 
 +
 +After this you have to choose which pins you'd like to use for you circuit and then translate the desired pins into the code for all of the components being used as well as to set the pins to output. 
 +
 +For STL0 the main operation in the code is a simple infinite loop while statement that uses the digitalWrite function to set the pin to low or high, indicating on or off and then a delay of (BLANK) milliseconds for the time blinking requirement. the delay says how long between the on and off cycle to wait.  
 +
 +STL1: Using __**4**__ LED's count to from 0 (0000) to 15 (1111) using binary 
 +
 +{{ :user:nbutler5:screenshot_2023-12-13_201806.png?nolink&600 |}}
 +
 +STL1
 +
 +The second STL project has you make a sequence of lights that turn on and off according to the binary value so the first sequence in the code or zero or in binary 0000 all lights are off because 0 indicates off and 1 indicates on. Which also means that the last number in the sequence before it starts over again is 15 and all 4 LED's are on because the binary value of 15 is 1111. The image of the circuit above can be adopted for STL1, just multiple everything by 4. 
 +
 +<code>
 +(0000) = (4th place, 3rd place, 2nd place, 1st place)
 +
 +
 +0 0 0 0 (0) - ZERO LIGHTS ON
 +0 0 0 1 (1) - 1ST LIGHT ON
 +0 0 1 0 (2) - 2nd LIGHT ON
 +0 0 1 1 (3) - 1st AND 2nd LIGHTS ON
 +0 1 0 0 (4) - 3rd LIGHT ON
 +0 1 0 1 (5) - 3rd AND 1st LIGHTS ON
 +0 1 1 0 (6) - 3rd and 2nd LIGHTS ON
 +0 1 1 1 (7) - 3rd, 2nd and 1st LIGHTS ON
 +1 0 0 0 (8) - 4th LIGHT ON
 +1 0 0 1 (9) - 4th and 1st LIGHTS ON
 +1 0 1 0 (10)- 4th and 2nd LIGHTS ON
 +1 0 1 1 (11)- 4th, 2nd and 1st LIGHTS ON
 +1 1 0 0 (12)- 4th and 3rd LIGHTS ON
 +1 1 0 1 (13)- 4th,3rd and 1st LIGHTS ON
 +1 1 1 0 (14)- 4th,3rd and 2nd LIGHTS ON
 +1 1 1 1 (15)- 4th,3rd,2nd and 1st LIGHTS ON
 +  
 +ROLLS OVER TO ZERO AND STARTS OVER AGAIN
 +(infinite loop)
 +</code>
 +
  
 ------------------------------------------------------------- -------------------------------------------------------------
  
 **PTBX -** **PTBX -**
 +
 +{{ :user:nbutler5:screenshot_2023-12-13_212207.png?nolink&600 |}}
 +{{ :user:nbutler5:screenshot_2023-12-13_212339.png?nolink&600 |}}
 +{{ :user:nbutler5:screenshot_2023-12-13_221837.png?nolink&600 |}}
 +{{ :user:nbutler5:screenshot_2023-12-13_221925.png?nolink&600 |}}
 +{{ :user:nbutler5:screenshot_2023-12-13_222025.png?nolink&600 |}}
 +
 +
 +
 +The first PTB project was to turn on and off a passive speaker, and also attach an indicator to show that the speaker is no or off (other than the sound that the speaker would make). The specific indicator was LED lights. RED LED on meant the speaker is off, and a GREEN LED on meant the speaker is on. 
 +
 +The second PTB project was to use the 10 element LED bar to count to 10, but adding a light for each value so instead of saying 2 is a light turned on in the 2's place, have two lights on sequentially stating the value 2. 
 +
 +The third and final PTB project was to use the multi-colored LED light that can display red, green, and blue light. The objective was to use three buttons, and preferably "label" them with there respective color caps to indicate when the blue capped button is depressed the a blue light will appear from the multi-colored LED. 
  
 ------------------------------------------------------------- -------------------------------------------------------------
  
 **EAPX -**  **EAPX -** 
 +
 +{{ :user:nbutler5:screenshot_2023-12-13_215739.png?nolink&600 |}}
 +{{ :user:nbutler5:screenshot_2023-12-13_201806.png?nolink&600 |}}
 +
 +EAPX 1-3 was an evolution of a project starting with the base program and adding features, then finally optimizing the code. 
 +
 +For the first evolution of the project was to use the stock code from freenove electronics kit tutorial page for the LCD module. Once I copied the code then I just cleaned it up and commented it so that I could understand it as well as make it more readable. The readability aspect was critical, because the stock code was lazily written and whoever wrote it wasn't very disciplined about the readability. 
 +
 +The second evolution of the project was to add a feature to the stock code. I added a blinking LED for whenever the LCD module updates its information, the information that was being updated was the CPU temperature of the Pi. 
 +
 +The third evolution of the project was to optimize the code. I implemented a statement in the terminal readout when the code was running indicating CTRL-C should be used to stop the program, as well as using more rigorous if statements for the wiringPiSetup function, and then cleaned up the code even more. 
  
 ------------------------------------------------------------- -------------------------------------------------------------
Line 206: Line 274:
  
 ------------------------------------------------------------- -------------------------------------------------------------
 +
 +PCTURES FOR EoCE 0x3 
 +
 +{{ :user:nbutler5:image1_9_.jpeg?nolink&600 |}}
 +{{ :user:nbutler5:image0_10_.jpeg?nolink&600 |}}
 +
 +-------------------------------------------------------------
 +
  
  
user/nbutler5/start.1702516455.txt.gz · Last modified: 2023/12/14 01:14 by nbutler5