Section outline

    • MicroController Project
       
      1. Learn About MicroControllers
         (small computers - Measure and Control)

      2. Learn to Control an Arduino MicroController

      3. Use an Arduino to Operate a Sumo Wrestling Robot
       
       

       


       
       

      In Class:

      Intro to MicroControllers - Mr. Rich

      Comic Strip - Pg 1 - 9
      Running your first program (sketch) - Blink
       
       
    • Demo: Blink

       

      Google Classroom:

      Link

      Coding App:

      BCS Arduino Cloud

      Assignment #1:
      Load Blink
      Save Blink as SOS

      Modify the code to blink 3 shorts - 3 longs - 3 shorts (Morse Code for S-O-S)
      Modify the code to blink Your Name in Morse Code
       
      note: make a short = 200ms
       
      Turning in Sketches to Google Classroom:
       
      To add your Arduino code directly to an assignment in Google Classroom, you can use the Share to Google Classroom button built directly into the Arduino Cloud Editor. This integration requires an active Arduino Cloud School Plan. [1, 2, 3]
      How to Turn in Your Sketch (For Students)
      Open your project: Log in to the Arduino Cloud and navigate to the Sketches tab to open the code you want to submit. [1, 2]
      Add documentation (Optional): If your teacher requested images, schematics, or project reports, you can attach them directly to your sketch inside the Cloud Editor. [1, 2]
      Click Share: Look for the Share to Google Classroom button located within the editor panel. [1]
      Choose your assignment: A Google Classroom pop-up window will appear. Select your specific class and the corresponding assignment from the dropdown list.
      Submit: Click Turn In (or Submit) to link your live Arduino sketch directly to your teacher’s gradebook. [1]
       
       

    • Assignment:

      With the Blink Sketch as a pattern, write a sketch that sends morse code to pin 13 (LED) of your first, middle and last name. 



      Morse Code
      Morse Code Timing 

    • Assignment #2 -

      Be sure you have shared your finished Assignment 1 - SOS & Name


      Parts: 1 Breadboard, 1 Red, Yellow, Green LED Stoplight, and at least 6 jumper wires. (1 Red, 1 Black, 4 others)

      In Class We'll Discuss:
        - CQCQ - Link
        -Morse Code to 800 hz - Link

      CdS
       
        -LEDs and Resistor Codes
        -Calculating Current Limiting resistor values in ohms
      (Ω) - 

      Ohm's Law  V=I R
               10mA at 5 Volt, 20mA at 5 Volt, Current at 5 Volts and 220
       ohms
      ** Note: Arduino Digital Pins can safely output a maximum of 40
      mA 


               
      Can't Resist

      -Comic Strip Pages 10 - 11 - Wiring LEDs on a breadboard
       
      - Don't let the Smoke Out !!! - Use only prescribed wiring !

      - Wire with the Power OFF (USB unplugged)


      With no Power to your Arduino:

      Wire 3 LEDs (with 3 Current Limiting Resistors) to Pins 4,5,6
      Pin4 to Stoplight Red
      Pin5 to Stoplight Yellow
      Pin6 Stoplight Green
      Gnd to Stoplight Gnd

      Stoplight Circuit


      1) Modify Blink to test each LED

      2) Write a program to simulate a traffic light.
      Green for 10 Seconds
      Yellow for 2 Seconds
      Red for 5 Seconds

      Add comment lines to the top of your program to explain what is wired to the Arduino






      Stoplight

       

    • ...

      Assignment 4 - Sound

       

      New parts: Speaker, CdS photoresistor, 10k Resistor (Br, Bl, Or, Gold)

      In Class:

      coil

      How a speaker works.

      Review Resistor Circuits:

      Current Limiting, Pull Down, Voltage Divider (Potentiometer), Pull Up

      See How a light sensitive resistor can create "Music":

       Examples - Basic - AnalogReadSerial -Determine range of A0 

        TonePitchFollower Code Link

      - Adjust to Pin 8 - Adjust to range of A0

       * 8-ohm speaker on digital pin 8 and Gnd

       * photoresistor on analog 0 to Gnd
       * 10K resistor (brown, black, red)  on analog 0 to 5v

      circuit

      Assignment:

      Write a program (sketch) that plays a song.

      Use the following as a guide:

      C Scale

      Note Values

      Table of Musical Frequencies          
                     
      Note Frequency   Note Frequency   Note Frequency
      C 130.82   C 261.63   C 523.25
      C# 138.59   C# 277.18   C# 554.37
      D 146.83   D 293.66   D 587.33
      D# 155.56   D# 311.13   D# 622.25
      E 164.81   E 329.63   E 659.26
      F 174.61   F 349.23   F 698.46
      F# 185   F# 369.99   F# 739.99
      G 196   G 392   G 783.99
      G# 207.65   G# 415.3   G# 830.61
      A 220   A 440   A 880
      A# 233.08   A# 466.16   A# 932.33
      B 246.94   B 493.88   B 987.77


      Treble and Bass Clefs

      Chromatic Scale - Link

    • Arduino Code to play the Chromatic Scale

    •  

      Demo: 2 Note Music - Tesla

      New Part: 7 LED Disk 

      For Duino app:
      Have your project open
      Click Libraries
      Search for FastLED
      Click Add

      Arduino Web Editor:
      FastLED should be preinstalled

      For Arduino PC/Mac app:
      Download FastLED library Here
      Click Libraries
      Beside Library Manager Click Import
      Upload the FastLED-3.2.1.zip


      Click FastLED Blink - Link

      1) Get 1 LED Blinking
      2) Blink All LEDs RED
      3) Blink All LEDS another Color

      Click FastLED Random Color Blink Code - Link

      Note: Num_LEDS variable, DATA_PIN variable, leds[NUM_LEDS] array, use FastLED.addLeds<NeoPixel...

      CRGB Defined Colors Link

      (Note Bottom of the WebPage Chart of Colors - may not reproduce accurately - varies with LED Strip)

      Assignment:

      Create a sketch that:

      1)  Lights all 7 lights the same color for 3 seconds, then changes all to another color (repeat until 6 colors have been shown)

      2) Lights each LED with a different color for 2 seconds (repeat for 6 color combinations)

      Extra Credit:

      Write a creative sketch for Mikey.

    • Applications of MicroControllers:

       
      MicroControllers Measure and Control 
      A 3D printer:
       - Measures temperatures of the extruder and print bed
       - Measures the extreme positions of the X,Y,Z axes (limiting switches)
       - Controls 4 stepper motors - X,Y,Z and extruder
       

       
      3-D Printing:
       
      Solidoodle 2
       
       
      Solidoodle 2
      Bambou P1S Printer
       
       
       
       
       
       
       
       
       
       
       
       
    •  

       
      Creality CR-6 Max - Print Sample Pawn

      Discuss: Pawn and Card-Holder-IOTA
       
      Rotate:
      rotate([45,45,45]){
      cube([30, 40,30], center = true);
      }

       
      1) Online OpenSCAD - OpenSCAD Cloud

      2) Online OpenSCAD

      3) Online OpenSCAD  

      4) BCS OpenSCAD 

      5) BCS OpenSCAD with Project Save

      OpenSCAD Cheatsheet

      1. Create object
      2. Store Code in Arduino Web Editor or Google Drive
      3. Convert to  STL
      4. Name file: username-title  i.e. jrich-castle
      5. Upload  stl file with Google Form like Arduino Code.
      6. Upload your Openscad code with Google Form like Arduino Code.
      7. email jrich@blackhawkchristian.org that you have a 3D print job ready

       
       
      Assignment 6:
      Create a small Castle with Towers,  Battlements and a Wall.
      Max Dimensions:  66mm x 66mm x 66mm (~ 2.5" Cube)


      castle1

      castle2

      castle3

       

       
       
       
Accessibility

Background Colour Background Colour

Font Face Font Face

Font Kerning Font Kerning

Font Size Font Size

1

Image Visibility Image Visibility

Letter Spacing Letter Spacing

0

Line Height Line Height

1.2

Link Highlight Link Highlight

Text Colour Text Colour