Applied engineering Team
/
TimelapseOkidac
Matija Pozojevic
Revision 0:b69a322d02df, committed 2015-06-19
- Comitter:
- mpozojevi
- Date:
- Fri Jun 19 16:44:32 2015 +0000
- Commit message:
- Timelapse okida?
Changed in this revision
diff -r 000000000000 -r b69a322d02df TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Fri Jun 19 16:44:32 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/wim/code/TextLCD/#d3496c3ea301
diff -r 000000000000 -r b69a322d02df main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 19 16:44:32 2015 +0000 @@ -0,0 +1,123 @@ +#include "mbed.h" +#include "TextLCD.h" +#include "string" +#include "stdlib.h" +DigitalIn next(p7); //tipkalo NEXT +DigitalIn back(p8); //tipkalo back +DigitalOut izlaz(LED2); //Pauza +DigitalOut izlaz2(LED1); //Ekspozicija +AnalogIn potenciometar(p15); +float vrijednost = 0; +float expo = 0; +std::string expoS; + +int pauza = 0; +int brexp = 0; +int a = 0; +TextLCD lcd(p19, p20, p21, p22, p23, p24); //rs,e,d0,d1,d2,d3 +// TextLCD lcd(p19, p20, p21, p22, p23, p24,TextLCD::LCD8x2); + +Serial pc(USBTX, USBRX); + +int main() +{ + lcd.cls(); + + + while (1) { + expo=potenciometar; + lcd.locate(0,0); + lcd.printf("Expo: "); + lcd.locate(0,1); + + + if (potenciometar < 0.2) { + lcd.printf("1/20s"); + expo = 1/20; + } + if (potenciometar > 0.2 && potenciometar <=0.4) { + lcd.printf("1/5 s"); + expo = 1/5; + } + if (potenciometar > 0.4 && potenciometar <=0.6) { + lcd.printf("1/2 s"); + expo = 1/2; + } + if (potenciometar > 0.6 && potenciometar <=0.8) { + lcd.printf("1 s"); + expo = 1; + } + if (potenciometar > 0.8 && potenciometar <=1.0) { + lcd.printf("2 s"); + expo = 2; + } + + wait (0.2); + + if (next==1) { + + while (1) { + + lcd.cls(); + lcd.printf("Pauza: "); + pauza = potenciometar * 10; + lcd.locate(0,1); + lcd.printf("%i ", pauza); + wait (0.2); + if (back ==1) break; + if (next==1) { + + lcd.cls(); + lcd.printf("Broj exp"); + while (1) { + + brexp = potenciometar * 10 +1; + lcd.locate(0,1); + lcd.printf(": %i ", brexp); + wait (0.2); + + { + if (back ==1) break; + if (next==1) { + + while (1) { + + do { + a++; + lcd.cls(); + lcd.locate(0,0); + lcd.printf("Exp br: "); + lcd.locate(0,1); + lcd.printf(" %i", a); + izlaz = 1; + izlaz2 = 0; + wait(expo); + + + lcd.cls(); + lcd.locate(0,0); + lcd.printf("Pauza br"); + lcd.locate(0,1); + lcd.printf(": %i", a); + izlaz = 0; + izlaz2 = 1; + wait (pauza); + } while (a<brexp); + + lcd.cls(); + lcd.locate(0,0); + lcd.printf("Gotovo"); + lcd.locate(0,1); + lcd.printf("!!!!"); + exit(1); + + } + } + } + + } + } + } + } + } +} \ No newline at end of file
diff -r 000000000000 -r b69a322d02df mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jun 19 16:44:32 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 \ No newline at end of file