====== Programming Microcontrollers ====== ====== Overview ====== **Overview of the course and materials** Introduction to programming microcontrollers is a class designed to teach high school students how to program Arduino based microcontrollers. Each lesson provides a powerpoint presentation which describes the key learning. The powerpoint also contains the basic circuit build instructions. Each lesson has advanced challenges, which are also described in the powerpoint file. There is an ".ino" file, which contains the program that is used to test the circuit. This program is also the basis for the more advanced challenges. The basic circuit and test program can be done with very minimal effort. The additional projects and challenges are designed to test knowledge. Examples of physical circuits and basic electronics for each lesson. ====== Materials ====== The class requires the [[https://www.sparkfun.com/products/13154 | SparkFun Inventors Kit]] as well as the [[http://arduino.cc/en/main/software | Arduino 1.0.6 IDE]] Advanced projects will require additional [[https://www.sparkfun.com/products/9065| servo motors]] and [[https://www.sparkfun.com/products/10335| pan/tilt brackets]]. This is required for [[https://www.dropbox.com/s/n68no91crng5p2e/MOV07421.MPG?dl=0 | lesson 8]]. The plastic enclosure was replaced with an [[https://www.sparkfun.com/products/11735 | Aluminum box]]. The project also uses a [[https://www.sparkfun.com/products/12043 | mini breadboard]] to allow the student to attach LEDs to the pan/tilt bracket. Lesson 13 requires a standard [[https://images.search.yahoo.com/images/view;_ylt=A0LEVvln_69UGFIA29kPxQt.;_ylu=X3oDMTBsa3ZzMnBvBHNlYwNzYwRjb2xvA2JmMQR2dGlkAw--?p=single+pole+light+switch&back=https%3A%2F%2Fsearch.yahoo.com%2Fyhs%2Fsearch%3Fp%3Dsingle%2Bpole%2Blight%2Bswitch%26ei%3DUTF-8%26hsimp%3Dyhs-001%26hspart%3Dmozilla&w=400&h=400&imgurl=www.homedepot.com%2Fcatalog%2FproductImages%2F400%2F5d%2F5dbcab70-9fba-4be9-8212-4e4f78a4e5a6_400.jpg&size=8KB&name=5dbcab70-9fba-4be9-8212-4e4f78a4e5a6_400.jpg&rcurl=http%3A%2F%2Fwww.homedepot.com%2Fp%2FLeviton-15-Amp-Single-Pole-Toggle-Switch-Light-Almond-R56-01451-02T%2F100669880&rurl=http%3A%2F%2Fwww.homedepot.com%2Fp%2FLeviton-15-Amp-Single-Pole-Toggle-Switch-Light-Almond-R56-01451-02T%2F100669880&type=&no=2&tt=120&oid=5ecec0342ac53a516dbbfc29d38be5f3&tit=15+Amp+Single-Pole+Toggle+Switch+-+Light+Almond&sigr=138plgq27&sigi=12r6ab6s1&sign=11cq7l62u&sigt=103vg5ole&sigb=134fr15g0&fr=yhs-mozilla-001&hspart=mozilla&hsimp=yhs-001 |single pole light switch]]. {{:ptz.jpg?200|}} The class doesn't require any programming experience nor any experience with electronics. ====== Introduction ====== **Basic projects - assuming no experience** * Lesson 1 : setting up the environment, overview : [[https://www.dropbox.com/sh/ruexve529owmagp/AACABCana91J4DcIZ5sLK4SCa?dl=0 | Lesson 1 resources ]] * Lesson 2 : using variables : analog versus digital : [[https://www.dropbox.com/sh/qr5r8yusr48vrp8/AABNUktZhmbzajxvmwhJcLI9a?dl=0 | Lesson 2 resources ]] * Lesson 3 : Permutations, combinations : Loops : [[https://www.dropbox.com/sh/fu5zzi988ni7l4y/AADO1giorVp9IzbQywwfEcLXa?dl=0 | Lesson 3 resources]] * Lesson 4 : Functions: Arrays : [[https://www.dropbox.com/sh/c648p72jl6lsw5l/AADc9RwS-h3l7WGNN9GrxlNra?dl=0| Lesson 4 resources]] * Lesson 5 : Conditional statements: Logical operators : Using buttons :[[https://www.dropbox.com/sh/jqyz4cqcr8yz16l/AAB64GUg7NAKRkPuNdeHnhIma?dl=0 | Lesson 5 resources]] * Lesson 6: Constants and function review: [[https://www.dropbox.com/sh/y2s8v14dbwls5du/AACvVGGzGqw90xs-aKn4mMQDa?dl=0 | Lesson 6 resources]] * Lesson 7: Debugging : Serial output : [[https://www.dropbox.com/sh/sppz2znoyb36sff/AABMdYeUbiu86iy8aVDu6OP3a?dl=0| Lesson 7 resources]] ====== Advanced ====== **Advanced projects - assuming the student has become confident with programming and electronics** * Lesson 8: Libraries : Code re-use: [[https://www.dropbox.com/sh/vn6hcmtaeufl96b/AABYrlRum1fHwbN0ZcrQpXWba?dl=0| Lesson 8 resources]] * Lesson 9: Sensors : real-time data: [[https://www.dropbox.com/sh/jigeqdgderzsnki/AABriy5VRzqzzDjMk6aXXG4ya?dl=0| Lesson 9 resources]] * Lesson 10: Soft potentiometer & data conversion :[[https://www.dropbox.com/sh/m6ajnpfko0h2gf5/AADC0pKpcaXu1STCMH1alOG0a?dl=0| Lesson 10 resources]] * Lesson 11: Serial input : ASCII : program control : [[https://www.dropbox.com/sh/5l7mdhacdrfdtx6/AADqmc_cMCcYc1e7Ame2QZZqa?dl=0| Lesson 11 resources]] * Lesson 12: Program control : Strings: [[https://www.dropbox.com/sh/sq0qp8t30cb5jv9/AADwjvuIUI8sSexbtEUZThS7a?dl=0| Lesson 12 resources]] * Lesson 13: Program state : relays: [[https://www.dropbox.com/sh/7attkc770mdol9s/AAB0R94I3xT0XDuogGx12Fsya?dl=0|Lesson 13 resources]] ====== Expert ====== **Expert projects - assuming the student has mastered the basic elements** * Lesson 14: Pointers, indirection and shift register: [[https://www.dropbox.com/sh/9zo7gwr9iriauyz/AADqCyP9z4pK1LBbv_nw5dc-a?dl=0|Lesson 14 resources]] * Lesson 15: Output format and LCD display: [[https://www.dropbox.com/sh/hjzun1lnkh7fudi/AADdwzwMEJh6J-12nOflzxAya?dl=0| Lesson 15 resources]]