aaaa12345
In my last class we gained more practice wiring circuits. We learned the difference between serial and parallel circuits. Do you remember the time when one bulb on a string of your Christmas lights would go out and as a result all the rest of the lights didn't work? Well that was because they were manufactured to be in a serial circuit.
In this way the circuit was broken with that one bulb which meant the electricity could not have a continuous flow. Pretty cool right? Who would have thought I would learn about electric circuits and how to create them in a design program.After wiring up a circuit with 4 LEDs we wrote the code to have them light up in a series one after another, and then to reverse.
We were able to program the speed at which they would light up, and after adding a control we could control this speed with a little knob. We were also able to write the code to control the brightness with this knob as well. Technically I now have the knowledge create some pretty cool custom Chrismas lights.
Here's a video of my LED circuit:Here is the code for the flashing lights above:/program to make a series of pins light up one at a timeint ledPins[] = 13, 12, 11, 10;void setup() /set the pinmode for all the pins for(int i=0; i=0; k--) digitalWrite( ledPins[k], HIGH ); knob = changeSpeed(); delay( knob ); digitalWrite( ledPins[k], LOW ); /end of loopint changeSpeed() int knob = analogRead( A0 );/get knob position/map it to the speed knob = map( knob, 0, 1023, 50, 500 ); /speeds will always be between 50 and 500 return(knob);Here is the code I to control the brightness using a knob:/program to change the brightness of the pinbased on the knob.int ledPins[] = 11, 10, 9, 6;void setup() /set the pinmode for all the pins for(int i=0; i=0; k--) analogWrite( ledPins[k], knob ); knob = changeLevel(); delay( 500 ); analogWrite( ledPins[k], LOW ); /end of loopint changeLevel() int knob = analogRead( A0 );/get knob position/map it to the speed knob = map( knob, 0, 1023, 0, 255 ); /Level will always be between 0 and 255 for analog Write return(knob);
·RELATED QUESTION
What are some of the cleverest inventions and ideas ever? Where can you purchase them, if possible?
Possibly some of them are the smartest inventions...
A show piece that can be disassembled to a sofa set and a centre table.
2. An automatic water pumper that quenches your dogs thirst.
3. A water bottle with some secret space.
4. Different Coca-Cola bottles for different uses.
5. A comb-cum-bottle
6. An ice-tray that produces diamond-shaped ice cubes.
7.
8. A ceiling hammock.. What a bliss!!
9. A cycle that has flexible structure that it can be tied around like this anywhere.
10. A shower with LED lights
that changes colour according to
the room temperature.
11.
12. An ice cream cup that comes with a lock.
13. Carpet alarm clock.
14. Waterproof touchscreen keyboard.
15. A toast-cum-omelette pan. A real time saver!!
16. A coffee mug that indicates temperature of the coffee...
17.
18. A pillow that wakes you up by the time you set...
19. Sleepers with LED lights which helps you to see the floor even in the dark.
20. Shark tea bags
Thank you so much for such an overwhelming response to my answer. Thanks upvoters :))
I'm adding a few more pictures to the answer, and hope you will like them too.
21. Pizza box oven
22. selfie toaster
23. Cookie cutter tray
24.
25. 3-D pen
26. Clear kayak
27. Linux smart pen that vibrates when you have spell something wrong.
28. Planet plates
29. Galaxy night light
30. Weight measuring chopping board.
That's it for now... will add more later :))