Posts

Showing posts from November, 2022

Challenge Week 5 Photo Resistor

Image
  1. Project : Photo Resistor: This changes resistance based on the amount of light the sensor receives .   2. Code:  3. Picture of the circuit:   4. Electronic Diagram: 5. Video explanation :  Code Explanation :       6. Challenge thinking: Started with adding wires and parts to the board. First the wires to ground to positive and 5v to negative.  Next the photoresistor into f5 and 6, a 10K resistor on one side connecting to i 1 and 5 then a wire to the negative side of the board from the resistor. On the other side of the 10K resistor, I connected  a wire to Analog port A0. The other side of the resistor connects to the negative side of the board with a wire. The LED into h20 positive and h21 negative.  Then a wire connects it to port 9 on the positive side and a 330K resistor to the negative side which connects to the negative side of the board.  The code: Started with the  const int sensorPin = A1; const int ...

Challenge Build 4: Dice

Image
  Challenge: Design, build, program and test an electronic dice machine. Code:  Completed Board: Electronic Diagram: Video Explanation: Challenge Thinking: I started by going to the Arduino site and looking at the circuit and code. This all looked very confusing. I first thought I would not be able to complete it because it suggested using different resistor than what I had in my kit. I decided to try using the 330k and the 10K. I then hooked up all the LEDs and the button. After I connected a 330K resistor to each LED on the positive side and the resistor to a port (2-8).The negative side of the LED was connected to the negative side of the board. Then I connected each side of the board to the negative to negative and the positive to positive to give each side ground and 5v power. After that I connected the  button to a 10k resistor and to the positive side. The last wire from the button connected to port 9 on the circuit. When I first compiled it, nothing worked so I un...

Circuit 3 RGB LED and 4 Multiple LED

Image
Circuit 3 Project: Driving an RGB LED; change colors with one LED RGB; use the circuit to create a color combinations   2. The code: The code seemed a little intimidating and confusing. I understood that digitalWrite parts of how to turn different pins high and low made different colors. The for() function is what confused me. This time I made sure to select my Arduino board before starting and copied the example code so I would not lose it. I also made a new sketch for just the code and typed it all out.   I ran the code the first time and got an error. Compilation error: a function-definition is not allowed here before '{' token I looked back at the example code to double check it. I was missing a close bracket at the end of the digitalWrite That fixed the problem! Completed Code: RGB LED 3. Completed Board 4. Electronic Diagram 5. Video explaining the project and how it works. This is the first video I made: When I first got it working, it was not showing all the col...

Makerspace Challenge 2: Potentiometer LED

Image
  Project : This week you will explore the difference between digital and analog data. You will use a potentiometer which is also known as a variable resistor.  By connecting a LED to the center pin, you will be able to control its brightness from fully on to off. Additionally, you will make use of both a digital pin and an analog pin.  The Code: This week I struggled with the code. I got my first error with the code. Sketch uses 970 bytes (3%) of program storage space. Maximum is 32256 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes. Failed uploading: no upload port provided. I realized that I had not selected my Arduino Com 3 in the program. Once I looked at the errors I realized when I was deleting comments, I accidentally deleted part of the code. I had to go to the website and look at the code for analog output in the examples and add it to my code. Once I did this then I realized I did not ha...