Changes between Version 20 and Version 21 of ControlSystems/Electrical/Training/FallTraining


Ignore:
Timestamp:
Dec 6, 2020, 2:02:20 PM (5 years ago)
Author:
Ryan Nguyen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/Electrical/Training/FallTraining

    v20 v21  
    1414
    1515[[Image(Resistor color code.png​, 25%)]]
     16
     17However, for TinkerCAD, you can just click on the resistor and set the units to ohms (looks like a horseshoe) and type in 370 to get a 370 ohm resistor.
     18Notice how the green wire right under the red LED is not close to the lead of the LED, but it is still connected. This is because all the holes on the breadboard in the center (between the black and red colored lines) are connected to each other vertically (in this orientation of the breadboard).
     19Another thing is that all the holes next to the black lines are connected to each other, and all the holes next to the red lines are connected to each other by a piece of metal.
     20LEDs only light up when they are connected so that electricity flows through it in the correct direction. The cathode side of the LED, which is the shorter metal leg, gets connected to the ground of the Arduino. The anode side of the LED, the longer leg, is connected to the digital pins.
     21This will require some code, which is provided:
     22void setup()
     23{
     24  pinMode(2, OUTPUT);
     25}
     26
     27void loop()
     28{
     29  digitalWrite(2, HIGH);
     30  delay(1000); // Wait for 1000 millisecond(s)
     31  digitalWrite(2, LOW);
     32  delay(1000); // Wait for 1000 millisecond(s)
     33}
     34Just copy and paste this into the code section of TinkerCAD (its the button next to start simulation, and after that, change the code type to text, and not blocks), or your arduino software (which is found at Software | Arduino) which you will need to have the arduino connected to your computer by USB to upload the code.
     35Finally, press start simulation on TinkerCAD, or press the upload button on your arduino software if you are using the arduino kit.
     36You should see the LED light up for 1 second, and turn off for 1 second in a repeated fashion.
     37