MAKECourse
  • Home
  • About
  • Course Materials
    • Software
    • Course Kits
    • TA hours
  • Videos
    • Intro to Programming Videos
    • Advanced Topics >
      • DAC and ADC Tutorial
      • SD Card Data Logging
      • DC Motor Control
  • Schedule
    • Syllabus
  • Student Projects
    • Awesome Prizes
    • Fall 2020 Projects
    • Fall 2016 Awesome Prize Winners
    • Fall 2016 Projects
    • Spring 2016 Awesome Prize Winners
    • Spring 2016 Projects
    • Fall 2015 Awesome Prize Winners
    • Fall 2015 Projects
    • Spring 2015 Awesome Prize Winners
    • Spring 2015 Projects
    • Fall 2014 Projects
    • Spring 2014 Projects

Week 12: Segment 1: USe of Pin Change Interrupts on the Arduino

This segment focuses on 'pin change interrupts' for the detection of events that occur sparsely and randomly such as a touch pad or button event. The difference between 'external' and 'pin change' interrupts is that the external interrupts only react to pins 2 and 3 on the Arduino, while the pin change interrupts can be used on all pins. The drawback of pin change interrupts is that the triggering pin usually needs to be detected in a second step, and that only pin change events can be defined as interrupts, and not specific transitions such as rising and falling edge.

Goals:

  • Understand the use of pin change interrupts that are triggered by pin events.
  • Learn to read out an array of switches.

In-Class Project:
  • Set up five switches and respond to them via pin change interrupts.

Materials for this segment:
  • Watch the video on the right 
  • Arduino sketch featured in the video (see link below video).
  • The ATmega328p data sheet. Look at Chapters 11 (interrupts, a table of the interrupt vectors is given here) 12 (external and pin change interrupts) and 13 (input/output ports) 

Main Arduino sketch used in the tutorial:
t16_pinchangeinterrupts_switches.zip
File Size: 2 kb
File Type: zip
Download File

[Home] [Course Materials] [Syllabus] [Student Projects] [Contact]
Powered by Create your own unique website with customizable templates.