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
    • 3D Printer Course
    • 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 6. Segment 2: Object Oriented Programming in Arduino Sketches

In this segment we will become more familiar with Object Oriented (OO) Programming, and we will explore 7-segment LED displays. You should have watched the object oriented programming tutorial in the first segment of week 6.

Goals:

  • Understand  7 segment LED displays
  • Write a class for controlling a 4-digit 7-segment LED display
  • Learn 'strobing' such a display for using all 4 digits
  • Learn to use arrays in C++

In-Class Project (and probably homework):
  • The 'methods' of this class should be:
    • void SevenSegmentLED:: SevenSegmentLED(int A, int B....int G, (int DP), int CC1...int CC4). This is the ‘constructor’, which defines the pins that are used to connect the display
    • void SevenSegmentLED::setValue(int number) (this is supposed to set the counter to a specific number 
    • int SevenSegmentLED::getValue() (this is supposed to return the current value of the counter)
    • void SevenSegmentLED::turnDisplayOn(int ontime) (this is supposed to strobe the display digits once; ontime is the duration per digit in microseconds).
    • void SevenSegmentLED::countUP(); this is supposed to increase the counter by +1.
    • void SevenSegmentLED::countDOWN() (this is supposed to decrease the counter by -1.
  • Experiment with the class and the circuit.  Add buttons to use the .setValue() .countDOWN .countUP and . turnDisplayOff() methods.
Materials for this segment:
  • Watch the video on the right.
  • Arduino Sketch featured in the tutorial (click on link below the video).


tutorialw6s2_7segmentdisplay4digits.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.