Circuit #1, Blinking a LED - Process
Starting from pin 13, it is assigned to output energy. Then from the loop function, the pin would first output a lot of energy, wait for a second, then reduce its output, and finally repeat after a second.
Product
To make the LED seem like it's barely blinking, I changed the first "delay(1000);" or one second to "delay(10);" which is to 1/100th of a second. The delay function waits a certain amount of time to proceed with the rest of the code. So in this case, I made the "digitalWrite(13, LOW);" or turning off the LED faster approaching than before.
Circuit #2, Potentiometer - Process
First, we assign variables "sensorPin" - 0 and "ledPin" - 13. The latter allows there to be an energy output from pin 13. The former establishes it beforehand so that "sensorValue" can have "analogRead" from the potentiometer. Finally leading us to "delay(sensorValue);" which is adjusted from the tangible potentiometer for keeping and offing the LED.
Product
A potentiometer (variable resistor) adjusts the volt output from 0 to 5 in this example to adjust the brightness of the LED.
Circuit #3, RGB LED - Process
The loop function repeats the main colors of the RGB color spectrum: red, green, blue, yellow, cyan, magenta, white, and black. Next the "showSpectrum();" function assigns a value to the "showRGB(x):" function to change the tint of the main colors.
Product
Function "showSpectrum()" creates the variable "x" which would increase from 0 - 768 as long it doesn't equal to or go over it. Next it summons function showRGB(x) so then inside that function it is assigned a different name, "color, " where it is split into different if statements that goes through the RGB rainbow from the 8 main colors and shows a different tint each time from the main color categories.
Circuit #4, Multiple LEDs - Process
Index would be the range of the numbered pins to see which pin to output high voltage which would then increase every time the code loops. In turn running through all the pins and there fore all the LEDs.
Product
This function turns one LED at a time then waits and off it eventually to loop to all LEDs from left to right.
The "pingPong" function starts at zero and adds till it gets to 7, then subtracts one until zero. This way, the LED would repeatedly light up in a cycle from left - right and right - left again.
Circuit #5, Push Buttons - Process
Uses "| |" and "& & " to read if the buttons are being pushed at whether or not only one of the two buttons are being pushed to set the output to high or otherwise low.
Circuit #6, Photo Resistor - Process
Sketch has manual parameters such as how bright and how dark it can get.
Product
manualTime() Pros -
time allows for specific light adjustment
Gets brighter in more light concentrated settings so you could potentially see it better
Cons -
Can't adjust automatically based on ambient light
Can't really be used to see in the dark
autoTime() Pros -
Adjusts so can be used in various light settings
Can be used to see in the dark
Cons -
Can't change to your preferences or certain light level
Circuit #7, Temperature Sensor - Process
Sketch uses "serial." code with "serial.begin(9600) to 10 serial monitor outputs per second. Then assigns float variables (fractions) so that you can convert the voltage into temperature (°C or °F) through analogPin.
Product
I made an "if statement" inside the voidLoop after variable "voltage" has been defined so that when the serial monitor shows a higher temperature, a higher voltage would follow and would initiate a high output to turn on the LED.
Circuit #8, A Single Servo - Process
The sketch uses servo functions from the library such as "servo1.write();" where you can input how much degrees you want to turn in addition to delay functions so the servo can actually perform it's tasks.
Product
I changed the number of steps the servo makes to it's maximum of one per 20 milliseconds and changed the delay times to 2000ms/2 seconds. This would make the servo go really fast to it's assigned angle in the allotted time then seem to slow down for a few seconds.
Circuit #9, Buzzer - Process
Multiple integer variables have been assigned lists in which the if statement goes through using the i/index variable so that if the note characters from "char notes[]" match then it would go through certain letter it matched with in the "int frequencies" list to assign the piezo speaker to emit in hz.
Product
I changed three place holders/variables here which was "const int songLength = 70" to match with the note capacity of the song, then "char notes[]" for the beat of the song then "int beats[]" to equal 1 beat for all the notes to produce the somewhat note length of "Mary had a Little Lamb" in hz.
Circuit #10, Spinng a Motor - Process
Product
Circuit #11, Relays - Process
Circuit #12, Shift Register - Process
Product
A Unique Circuit
I created two functions inside voidLoop which uses index to go from pin 13 - 9 which lights up the LED from top to bottom and the "L" suffix which goes from 9 - 13 or from bottom to top. The circuit takes an input from the button through pin #2 labeled buttonPin which then if labeled "LOW" in buttonState would run the first "oneAtATimeR"/(!3 - 9) or if it reads "HIGH" it would run the else function of "oneAtATimeL)/(9 - 13). You should see one of the LEDs light up from top to bottom because the functions are summoned inside a loop so it would run the code repeatedly from 13 - 9, 5 times until it is less than 9. Or it would run it from 9 -13, 5 times again until it is greater than 13. So only one of the LEDs should light up at a time.