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 mbed-rtos MLX90614
Diff: main.cpp
- Revision:
- 7:11675c1dce4f
- Parent:
- 6:49a007861c76
- Child:
- 8:81ed1135ba02
--- a/main.cpp Sat May 30 14:58:44 2015 +0000
+++ b/main.cpp Wed Jun 03 12:22:46 2015 +0000
@@ -1,12 +1,14 @@
#include "UserInterface.h"
#include "st7565LCD.h"
+#define WAIT_TIME 0.3
+
ST7565 st7565(_MOSI, _SCLK, _CS, _RST, _A0); // mosi, sclk, cs, rst, a0
Serial pc(USBTX, USBRX); //rx, tx
//buttons
-DigitalIn down(p18);
-DigitalIn select(p19);
+DigitalIn down(p19);
+DigitalIn select(p22);
DigitalIn up(p20);
int main(){
@@ -71,7 +73,7 @@
main_menu->addItem(thermo);
//create header object
- Header * header = new Header(70, "", &st7565);
+ Header * header = new Header("", &st7565);
//set header and current menu
ui->setCurrent(main_menu);
@@ -79,17 +81,23 @@
ui->init();
while(1) {
- if(!down){
- ui->update('s'); //ascii 115
- wait(0.2);
- }
- else if(!select){
+ if(select){
+ wait(0.1);
+ printf("select\n");
ui->update('y'); //ascii 121
- wait(0.2);
+ wait(WAIT_TIME);
}
- else if(!up){
+ else if(up){
+ wait(0.1);
+ printf("up\n");
ui->update('w'); //ascii 119
- wait(0.2);
+ wait(WAIT_TIME);
+ }
+ else if(down){
+ wait(0.1);
+ printf("down\n");
+ ui->update('s'); //ascii 115
+ wait(WAIT_TIME);
}
}
}
\ No newline at end of file