One player pong with seven segment display for score keeping

Dependencies:   4DGL-uLCD-SE PinDetect SDFileSystem mbed-rtos mbed wave_player

Fork of ECE2036Lab2StarterCode by Joseph Lind

Committer:
jlind6
Date:
Tue Jun 17 20:03:41 2014 +0000
Revision:
0:356124c0bafc
Child:
1:839d22d423bd
Initial Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jlind6 0:356124c0bafc 1 #include "uLCD_4DGL.h"
jlind6 0:356124c0bafc 2
jlind6 0:356124c0bafc 3 class TempModule
jlind6 0:356124c0bafc 4 {
jlind6 0:356124c0bafc 5 public:
jlind6 0:356124c0bafc 6 // Constructors
jlind6 0:356124c0bafc 7 TempModule(PinName pin);
jlind6 0:356124c0bafc 8 TempModule(PinName pin, float vx, float vy);
jlind6 0:356124c0bafc 9 // Reading temperature values
jlind6 0:356124c0bafc 10 float read();
jlind6 0:356124c0bafc 11 // Set Functions
jlind6 0:356124c0bafc 12 void setBaseVx(float); // This sets the lowest velocity of vx
jlind6 0:356124c0bafc 13 void setBaseVy(float); // This sets the lowest velocity of vy
jlind6 0:356124c0bafc 14 // Get Functions/Member Functions
jlind6 0:356124c0bafc 15 float getVx(); // Calculates a speed based off of the temp
jlind6 0:356124c0bafc 16 float getVy();
jlind6 0:356124c0bafc 17 float getVx(uLCD_4DGL *); // Same thing as getVx(), except it
jlind6 0:356124c0bafc 18 // also writes the temp to the screen.
jlind6 0:356124c0bafc 19
jlind6 0:356124c0bafc 20 private:
jlind6 0:356124c0bafc 21 // Data members are suggestions, feel free to add/remove
jlind6 0:356124c0bafc 22 AnalogIn _sensor;
jlind6 0:356124c0bafc 23 float roomTemp;
jlind6 0:356124c0bafc 24 float holdTemp;
jlind6 0:356124c0bafc 25 float basevx;
jlind6 0:356124c0bafc 26 float basevy;
jlind6 0:356124c0bafc 27 int counter;
jlind6 0:356124c0bafc 28 };
jlind6 0:356124c0bafc 29
jlind6 0:356124c0bafc 30 TempModule::TempModule (PinName pin) : _sensor(pin)
jlind6 0:356124c0bafc 31 {
jlind6 0:356124c0bafc 32 // Constructor code goes here
jlind6 0:356124c0bafc 33 // you can ignore initializing _sensor, we've already done that
jlind6 0:356124c0bafc 34 }
jlind6 0:356124c0bafc 35
jlind6 0:356124c0bafc 36 TempModule::TempModule (PinName pin, float vx, float vy) : _sensor(pin)
jlind6 0:356124c0bafc 37 {
jlind6 0:356124c0bafc 38 // Constructor code goes here
jlind6 0:356124c0bafc 39 // you can ignore initializing _sensor, we've already done that
jlind6 0:356124c0bafc 40 }