Program that uses Heater library.
Dependencies: C12832 Heater mbed
Revision 0:0d4d8699028e, committed 2015-01-22
- Comitter:
- tbjazic
- Date:
- Thu Jan 22 13:40:11 2015 +0000
- Commit message:
- Library published.
Changed in this revision
diff -r 000000000000 -r 0d4d8699028e C12832.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Thu Jan 22 13:40:11 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/chris/code/C12832/#7de323fa46fe
diff -r 000000000000 -r 0d4d8699028e Heater.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Heater.lib Thu Jan 22 13:40:11 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/TVZ-Mechatronics-Team/code/Heater/#eb243c2ffbfe
diff -r 000000000000 -r 0d4d8699028e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jan 22 13:40:11 2015 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" +#include "Heater.h" +#include "C12832.h" + +int main() { + Heater h(p19, LED1); + float minTemp = 18; + float maxTemp = 26; + h.configureSensor(minTemp, maxTemp); + C12832 lcd(p5, p7, p6, p8, p11); + lcd.cls(); + AnalogIn pot2(p20); + float thermostat; + while(true) { + thermostat = minTemp + (maxTemp - minTemp) * pot2.read(); + h.setTemperature(thermostat); + lcd.locate(0, 0); + lcd.printf("Desired temperature: %.1f", thermostat); + lcd.locate(0, 10); + lcd.printf("Current temperature: %.1f", h.readTemperature()); + char s[4]; + if (h.isHeaterOn()) + strcpy(s, "ON "); + else + strcpy(s, "OFF"); + lcd.locate(0, 20); + lcd.printf("Heater state: %s", s); + wait(1); + } +} \ No newline at end of file
diff -r 000000000000 -r 0d4d8699028e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jan 22 13:40:11 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file