![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
finales
Dependencies: mbed Servo HC-SR04 TextLCD max6675 SLCD
Revision 2:828a15eaad12, committed 2020-06-10
- Comitter:
- juanespitiarobotica
- Date:
- Wed Jun 10 15:21:04 2020 +0000
- Parent:
- 1:0371f6d48091
- Commit message:
- completo
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 0371f6d48091 -r 828a15eaad12 main.cpp --- a/main.cpp Wed Jun 10 00:25:16 2020 +0000 +++ b/main.cpp Wed Jun 10 15:21:04 2020 +0000 @@ -32,21 +32,24 @@ void temp_hora() { - set_time(1256729737); + set_time(1591802062-18000); int cf = 0; while (1) { time_t seconds = time(NULL); float temp = sensor.gettemp(cf); - printf("%d", seconds); - printf("Fecha= %s", ctime(&seconds)); + //printf("%d", seconds); + //printf("Fecha= %s", ctime(&seconds)); char buffer[32]; strftime(buffer, 32, "%H:%M:%S ", localtime(&seconds)); - printf("%s", buffer); + lcd.locate(0,1); + lcd.printf("%s", buffer); - printf("%4.2f%cF \n\033[2K\033[1A",temp,176); + //printf("%4.2f%cF \n\033[2K\033[1A",temp,176); lcd.locate(0,0); - lcd.printf("temp:%1.2f\n",temp); + lcd.printf("temp:%1.2f",temp); + lcd.locate(11,0); + lcd.printf(" "); Thread::wait(1000); } @@ -60,12 +63,12 @@ while(1) { for(int i=0; i<100; i++) { servomotor = i*0.01; - printf("%d",i); + //printf("%d",i); Thread::wait(100); } for(int i=100; i>0; i--) { servomotor = i*0.01; - printf("%d",i); + //printf("%d",i); Thread::wait(100); } } @@ -75,8 +78,10 @@ { while(1) { float distancia=ultrasonido.getCm(); - lcd.locate(0,1); - lcd.printf("dist:%2.f cm\n",distancia); + //lcd.locate(0,1); + printf("distancia:%2.f cm\n",distancia); + //lcd.locate(11,1); + //lcd.printf(" "); Thread::wait(1000); } } @@ -92,12 +97,19 @@ int main() { - - thread.start((ultra)); + thread.set_priority (osPriorityNormal); thread1.start ((servo)); + //thread1.set_priority (osPriorityNormal1); thread2.start ((temp_hora)); - thread3.start ((pantallalcd)); + //thread2.set_priority (osPriorityNormal2); + thread3.start((pantallalcd)); + //thread3.set_priority (osPriorityNormal); thread4.start ((seg)); + //thread4.set_priority (osPriorityNormal3); + thread.join(); + //ThisThread::sleep_for(5000); + + } \ No newline at end of file