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:
- 4:024e6a9c2ebf
- Parent:
- 3:688b62ff6474
- Child:
- 5:5b1a8ad6c187
--- a/main.cpp Sun Apr 26 16:29:53 2015 +0000
+++ b/main.cpp Mon May 25 14:46:39 2015 +0000
@@ -2,12 +2,11 @@
#include "st7565LCD.h"
//define mbed pins
-#define _MOSI p11
-#define _MISO p12
-#define _SCLK p13
-#define _RST p8
-#define _A0 p25
-#define _CS p26
+#define _MOSI p5
+#define _SCLK p7
+#define _RST p24
+#define _A0 p8
+#define _CS p6
ST7565 st7565(_MOSI, _SCLK, _CS, _RST, _A0); // mosi, sclk, cs, rst, a0
Serial pc(USBTX, USBRX); //rx, tx
@@ -16,10 +15,7 @@
DigitalIn down(p18);
DigitalIn select(p19);
-int main(){
- //create god UI object
- UI * ui = new UI(&st7565);
-
+void init_config(UI *ui){
//create main menu
Menu * main_menu = new Menu(" Main Menu", &st7565);
@@ -87,6 +83,13 @@
ui->setCurrent(main_menu);
ui->setHeader(header);
ui->init();
+}
+
+int main(){
+ //create god UI object
+ UI * ui = new UI(&st7565);
+ //initialize configuration
+ init_config(ui);
while(1) {
if(down){