So much stuff to learn today!
Review
- Digital in/out
- If()
serial.print(), serial.println()
other variables
-
int const int long char string boolean or bool byte
- char: can store one letter e.g ‘a’
- for strings, use double quotes: “abc”
- byte: 8 bits: 0-255 unsigned
Resistive sensors
- Light sensor
- Does the circuit remind you of anything?
- voltage divider https://learn.sparkfun.com/tutorials/voltage-dividers
-
analogRead()
- Other resistive sensors: force Sensitive Resistor (FSR), bend sensor, thermistor
- Potentiometer
Dimming an LED
-
analogWrite()
Do along with me
- Build potentiometer circuit
- Always test first with built-in example
- First make blink speed
- Then make fade
- Maybe make both?
- map()
- constrain()
- The example we developed in class is here
Miscellaneous
if()
all possibilities
&& || !
millis()
Assignment due Tuesday February 18
Reading
- Read the readings from the reading list. If this is assigned to you, be prepared to lead the discussion
Production
- Get information from at least one analog sensor and at least one digital sensor (switch), and use this information to control at least two LEDs, one in a digital fashion and the other in an analog fashion, in some creative way
- If your previous assignment already did all these things you may reuse it, or create a new system.
- Document your work:
- Create a new folder in your github repository called “February18”
- Upload a picture of your circuit schematic. Your schematic, whether hand drawn or otherwise, must be clear. Remember what a schematic is and is not.
- Upload a photograph of your project
- Create a new file called “description.md” and include:
- A description of your concept and how it was achieved
- Your schematic
- Your photograph
- Problems, if any, and solutions, if any
- Anything else you can think of
- Upload your program. Remember to keep the .ino extension so that it is formatted properly.