Before v. After
The original circuit is designed to turn the LED on and off every second, while the new code has it blink every 1/10th of a second.
In this circuit we are using a potentiometer ( A potentiometer, or "pot" for short, is a control knob. A potentiometer changes resistance as it is turned. By using it as a "voltage divider", the Arduino can sense the position of the knob, and use that value to control whatever you wish) to control the blink rate of an LED.
In this circuit we make a RGB LED cycle through the color spectrum using some code. The code was written for us, but had extra pieces that you had to remove. To the right is the code I used other than declaring basic variables.
Schematic for circuit
Video of working circuit.
Both of the additional functions use the same circuit, which is pictured to the right.
This is the code that makes the lights work, and below is a video of this function working.
The code for the function is on the left, and the video of it working is below.
Circuit 5 is all about taking the inputs from buttons to make a light work. For this circuit we didn't make any changes to the code or the circuit.
ManualTune function vs. Autotune function
Both of these programs use the same circuit, which involves a photoresistor. Photoresistors sense light, and we will use this to determine the brightness of a light.
For manualTune() we need to manually change our range of light levels so that our light brightens and dims according to the light level of the room, because we will not get the full range of the led if we use all of the values that the analogpin can recieve.(we can't get complete darkness or complete light) This means that, although it will take more time, we can precisely control what light values will be accepted as inputs for the brightness of the led. In my circuit I used 200,900 to get fairly accurate light readings.
For autotune the Arduino takes the spectrum of values that the photo resistor detects(less than the full range typically) and uses the highest and lowest to accurately create a range of values to brighten or dim the light accurately depending on the darkest and brightest the room can possibly be. This makes it so that the LED more accurately brightens and dims, and is less work. The one thing about auto is you can't determine exactly what light values you want the light to change with, it's just how bright and how dim the room gets.
This circuit uses a temperature sensor to turn on an LED with certain temperatures. I modified the original circuit that only had the temp sensor(Pictured middle), to the circuit with an LED(Right)
The original code on the left simply gets the temperature of the surrounding area, but doesn't do anything with it. The new code below will make the LED turn on when the surroundings are above 80℉.
Both the process and product use the same circuit, the diagram on the left shows how you can put it together yourself.
In circuit 8 we attach a servo and control it using our code. We can have the motor go quickly to a degree position between 0-180 degrees using the code below, which makes it act like it does in the video below.
An alternative is having the motor gradually go the 0-180 degrees, which leads to more fluid and stable movement, but takes slightly longer. We can do this with the code below, where you just need to change the delay, original position, final position, or the length of the step, to change the speed of the motor. I changed the rate of change in position from +2 each time to +8.
This circuit uses a buzzer, changing its voltage hundreds of times a second, to create specific tones. These tones would be quite annoying to manually place, so we have code that converts note notation into when the voltage should change to create tones. The notes are inserted in the form of a list function included that does these conversions. The notes also have length, which corresponds to how long the note plays, this is also inserted in list format. I used these notes to make a song that you might recognize, using the code below.
Don't recognize it? It's the intro to Jurassic Park!
This circuit accelerates and decelerates a motor, and you can make it have a faster max speed and speed up faster, I made mine accelerate in half the time by changing the delay from 20 to 10.
Ran out of time due to technical issues.
My unique circuit is a combination of circuits 6(potentiometer) and 9(Piezo), and uses the input from the potentiometer to determine how fast a song will be played. It uses the code in the image below, and the circuit layout of the image to the right.