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: mbed tempRegulator
Diff: main.cpp
- Revision:
- 1:bee82719a604
- Parent:
- 0:e2969f655e3e
--- a/main.cpp Thu Dec 01 08:54:40 2022 +0000
+++ b/main.cpp Thu Dec 01 18:40:26 2022 +0000
@@ -22,6 +22,8 @@
int huh;
int n;
+
+// provjera dali je temperatura viša od dozvoljene
void takeMasurement()
{
if (temperature > tempLimit){
@@ -61,6 +63,7 @@
}
+// postavljanje maksimalno dozvoljene temperature
void setTemperatureLimit()
{
@@ -106,79 +109,5 @@
}
}
-/*
-char SegConvert(char SegValue) // function 'SegConvert'
-{
- char SegByte = 0x00;
- switch (SegValue) { // DP G F E D C B A
- case 0:
- SegByte = 0x3F;
- break; // 0 0 1 1 1 1 1 1 binary
- case 1:
- SegByte = 0x06;
- break; // 0 0 0 0 0 1 1 0 binary
- case 2:
- SegByte = 0x5B;
- break; // 0 1 0 1 1 0 1 1 binary
- case 3:
- SegByte = 0x4F;
- break; // 0 1 0 0 1 1 1 1 binary
- case 4:
- SegByte = 0x66;
- break; // 0 1 1 0 0 1 1 0 binary
- case 5:
- SegByte = 0x6D;
- break; // 0 1 1 0 1 1 0 1 binary
- case 6:
- SegByte = 0x7D;
- break; // 0 1 1 1 1 1 0 1 binary
- case 7:
- SegByte = 0x07;
- break; // 0 0 0 0 0 1 1 1 binary
- case 8:
- SegByte = 0x7F;
- break; // 0 1 1 1 1 1 1 1 binary
- case 9:
- SegByte = 0x6F;
- break; // 0 1 1 0 1 1 1 1 binary
- case 10:
- SegByte = 0x00;
- break; // 0 1 1 0 1 1 1 1 binary
- }
- return SegByte;
-}*/
-
-/*
-void getTemps(AnalogIn LM35){
- float tempC,tempF,a[30],avg;
- int i;
- avg=0;
- for(i=0; i<20; i++) {
- avg+=LM35.read() / 20;
- wait(.03);
- }
-
-
- tempC=(avg*3.3*100);
- pc.printf("tempC %f", tempC);
- float temp = tempC - (int)tempC;
- if(temp > 0.25 && temp < 0.75){
- tempC = (int)tempC + 0.5;
- }
- else if (temp > 0 && temp < 0.25) {
- tempC = (int)tempC;
- }
- else if (temp > 0.75){
- tempC = (int)tempC + 1;
- }
- pc.printf("avg %f", tempC);
-
-
- tempF=(9.0*tempC)/5.0 + 32.0;
- pc.printf("temperature = %.1f ^C\r\n", tempC);
-
- }
- */
-