topics:arduino_programming
Table of Contents
Arduino Programming
In a Nutshell
- Printing to the Serial Monitor in a nutshell
- Pulse-width modulation (PWM) in a nutshell
Lecture Notes, Worksheets and Slides
Orientation to the Arduino IDE
- The “blink” sketch: slides in PDF
- Blink any LED: slides in PDF
Variable types, integer and floating point arithmetic
- Worksheet to compare variable types: Blank version handed out during lecture and Completed version
Reading voltage and printing to the Serial Monitor
- Notes on reading a potentiometer
- Slides on analog reading and printing to the Serial monitor
- Printing to the Serial Monitor in a nutshell
- Case study of reading a potentiometer and photoresistor: Lecture slides in PDF
"if" and "if-else" constructs
PWM Output
- Lecture slides in PDF on PWM output on an Arduino UNO
Loops
- Introduction to “for” loops: slides in PDF, Example of nested for loops
- Supplemental notes on for loops in Arduino
- Supplemental notes on while loops in Arduino
- Meta notes on the relationship of the loop function to for and while loops
User-defined functions
- in class example on averaging multiple readings
- Screencast on YouTube
Applications of Arduino Programming
- Case study of reading a potentiometer and photoresistor: Lecture slides in PDF
- Breathing LED
- Lecture slides (PDF) and long form notes (PDF) on equations for the breathing LED model.
- Lecture slides (PDF) and long form notes (PDF) on implementing the breathing LED model in Arduino code.
- Controlling the motion of servo motors
- Arduino servo library: Link to arduino.cc
- Sweep tutorial included as an example in the Arduino IDE
- Controlling the motion of DC motors
- DC motor speed control with Arduino and H-bridge: Lecture slides (PDF)
- DC motor speed control with Arduino: Lecture slides (PDF)
- Experiment 10 from the Sparkfun Tinker Kit
- ME 491 notes on using a joy stick to control DC motors
- Button input for Arduino
- Lecture slides that include “while” loops and interrupts): PDF
- Debouncing a button input without using interrupts PDF and Arduino code
- Detailed notes on using buttons for input (PDF)
Lecture slides in video format
Orientation to the Arduino IDE using the "blink" sketch
(13:45)
Introduction to "if" and "if-else" constructs
(7 min)
Introduction to "for" loops
(7:32)
User-defined functions
(19:30) ,
Good Practice in circuits and programming
(9:45)
PWM output on Arduino
Button Input
Button input for Arduino (includes “while” loops and interrupts):
(37 min)
External Reference materials
- Foundations of Arduino Hardware and Software at arduino.cc
- Arduino programming reference at arduino.cc
- Arduino tutorials at arduino.cc
- Sparkfun Tinker Kit Activity Guide
- … and more
- Sparkfun's Arduino Cheat Sheet
- Arduino programming at learn.adafruit.com
- Lesson 0: getting started
- Lesson 1: Blink
- Lesson 2: LEDs
Curriculum from Sparkfun
Sparkfun sells gear. It's their business and they have been successful.
Sparkfun also has a strong ethic of supporting open source software and hardware. As part of their community outreach and support, and as a way of building their brand, Sparkfun has developed an educational web site https://learn.sparkfun.com/. The relevant parts of their website for ME 120, 121, and 122 are these links
topics/arduino_programming.txt · Last modified: 2020/04/06 18:26 by gerry