Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE PinDetect SDFileSystem mbed-rtos mbed wave_player
Fork of ECE2036Lab2StarterCode by
tempModule.cpp
00001 #include "mbed.h" 00002 #include "uLCD_4DGL.h" 00003 #include "tempModule.h" 00004 00005 TempModule::TempModule(PinName pin) : _sensor(pin) 00006 { 00007 setBaseVx(1.6); setBaseVy(1.2); 00008 } 00009 00010 TempModule::TempModule(PinName pin, float vx, float vy) : _sensor(pin) 00011 { 00012 setBaseVx(vx); setBaseVy(vy); 00013 } 00014 00015 void TempModule::setBaseVx(float vx) {basevx = vx;} 00016 void TempModule::setBaseVy(float vy) {basevy = vy;} 00017 float TempModule::getVx() { 00018 float _vx = 0.0; float anaTemp = read(); 00019 _vx = basevx * anaTemp + 2.3; 00020 return _vx; 00021 } 00022 00023 float TempModule::getVy() { 00024 float _vy = 0.0; float anaTemp = read(); 00025 _vy = basevy * anaTemp + 1.6; 00026 return _vy; 00027 } 00028 00029 float TempModule::getVx(uLCD_4DGL *temp_uLCD) { 00030 float _vx = 0.0; float anaTemp = read(); float temperature = 0; 00031 _vx = basevx * anaTemp; 00032 temperature = ((anaTemp*3.3)-0.500)*100.0; 00033 temp_uLCD->locate(0,15); 00034 temp_uLCD->printf("%f", temperature); 00035 return _vx; 00036 } 00037 00038 float TempModule::read() { 00039 return _sensor.read(); 00040 }
Generated on Tue Jul 19 2022 14:32:53 by
1.7.2
