Posts

Showing posts from November, 2021

Week 4 arduino challenge (dice machine)

Image
 This week we had to create a dice machine with our Arduino. The purpose of the code and layout was that by pressing a button you will get random numbers from 1 to 6 out.  For this you needed to write out and give each pin an led. There was also a button involved.  This is the code that I wrote for it.  Video explanation of project:  Reflection: This project was a combination of the previous projects we have done. I didn't want to risk it with a map but I learned that you could map out the lights and shorten your code.  Another learning moment was the understanding of the button function and how you can make a circuit or there are two circuits in there and can be split on both sides of the bread.  Extension : Just for a game you can easily make a dice machine for the sole purpose of the game. This can add a digital component to a board game. This can also work for your christmas lights to keep a random flow coming and the lights vivid, to replicate nat...

Arduino Challenge extension of #3

Image
What I did here was combined the codes for the photoresistor and levels of the lights.  What the code does.  1. It dims the lights and turns them off a different brightness 2. It turns them all off when the presence of brightness is there.  3. When it turns them back on it does it in a sequence and goes to full brightness.  Code Video of Code explanation Video of Final Product

Arduino Challenge #3 analog to digital write

Image
 Let me begin to explain what I did at the beginning.  This is the code: beginning 2 pins are used the 0 goes to an analog and the 9 to digital ledpin .  In this exercise we got the information from the analog pin to come from a sensorPin, this sensor was a light sensor. The parameters ranged from 9600 to 0. 0 to 800 we set it up to be darkness, then the signal told the sensor to send a signal to the led and turn it on. Anything above 800 was light therefore the light was off. The problem here was the resistors since in order to get the signal to that level we have to use a 10k ohm resistor in both the light and the sensor. 20k so we can get the level of data coming through. Now this is a video with 20 10k ohm resistors.  You will see that the light had to be really bright outside in order for it to work. I had to use the phone lamp to make it work.  On this next step I added the MAP command, which maps out the numbers that the digital led read to tell the light...

Experiment 2 challenge: potentiometer

Image
 I'm officially stuck here. This is the code and I just modified it to add another int and led on 12. The light turns but the  potentiometer does not apply to the other light..  UPDATE: got both blinking lights and both of them reading from the meter. Had to add a delay part of it to adhere to the digital write ledpin2 i had.  Explanation in the video.  3 led lights working with the meter.  CODE int sensorPin = 0;     int ledPin = 13; int ledPin2=12;  int ledPin3=11;    void setup()  {  pinMode(ledPin, OUTPUT);    pinMode(ledPin2, OUTPUT); pinMode(ledPin3, OUTPUT);  } void loop()  {  int sensorValue;   sensorValue = analogRead(sensorPin);       digitalWrite(ledPin, HIGH);digitalWrite(ledPin2, HIGH); digitalWrite(ledPin3, HIGH);       delay(sensorValue); delay(sensorValue);  delay(sensorValue);              ...

Experimen 2: Reading a potentiometer.

Image
 This experiment was made to test out a potentiometer.  Potentiometer is a knob that regulates the amount of electricity that goes through a circuit.  The purpose of this experiment was to make the Potentiometer control the blinking of the light, the more energy provided (5V) the more it blinks and then the blinking can't be seen because it is too quick.  Code:  int sensorPin = 0;     int ledPin = 13;      void setup()  {  pinMode(ledPin, OUTPUT);  } void loop()  {  int sensorValue;   sensorValue = analogRead(sensorPin);       digitalWrite(ledPin, HIGH);        delay(sensorValue);                                    digitalWrite(ledPin, LOW);         delay(sensorValue);  } This is the result of the code https://www.youtube.com/watch?v=MmtoccjWXAk ...

The post mortem after challenge number 1 on the arduino! UNO

  I'm familiar with coding in the sense that I have experience with making things work in a series. I have used code, scratch, linux and other junk! Yes I said it Junk! Why because I really like this junk. I refer to it as junk because outside the people who are interested it just looks like a lot of junk to the untrained eyes. (I'm sounding very junkish right now and I know it).  This post-mortem is giving me a lot of insight at the different ways people learn here. A lot of us don't follow instructions the first time around. As a matter of fact I'm currently digging in the trash can to see the time needed for the mac and cheese. After looking at others version of their code I realize that I bought a different version of the Arduino. Not the different board or any of the other stuff but you all got a book and I just got the box.  This is because I went and looked up an old syllabus from the class and bought what was in there. It does the work but I kept hearing about t...

Maker Challenge number 1 Blinking LED

Image
 This week began the makerspace course I wanted in order to complete my masters in educational technology. In this course we will be working with the Arduino, which is an open source code program to create and upload the programs to our ELEGOO uno R3. This last thing is a small computer that comes with a bunch of cables and boards to work with. It is pretty awesome!  This week goal was to turn on an LED and make it blink for a certain amount of time.  The task was a success and the code was this one.  /*   Blink   Turns on an LED on for one second, then off for one second, repeatedly.      This example code is in the public domain.  */   // Pin 13 has an LED connected on most Arduino boards. // give it a name: int   led   =   13 ; // the setup routine runs once when you press reset: void   setup ( )   {                      // initialize the digital pin ...