Dimitar Marinov
/
Nucleo_4_encoders_w_Nokia5110
4 Rotary encoders with 5110 LCD display. For Nucleo boards
Diff: main.cpp
- Revision:
- 3:bf5e17e09fe3
- Parent:
- 2:7d10aa2795c5
- Child:
- 4:cd50b7dfaf27
--- a/main.cpp Sun Sep 18 19:21:12 2016 +0000 +++ b/main.cpp Wed Sep 21 06:57:27 2016 +0000 @@ -1,16 +1,19 @@ #include "mbed.h" #include "N5110.h" #include "REnc.h" - +//https://developer.mbed.org/users/mbed_official/code/mbed-src/file/c9b73cd93427/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/PeripheralPins.c //DigitalOut red(LED1); //DigitalOut blue(LED2); //DigitalOut green(LED3); + int i; // VCC,SCE, RST, D/C, MOSI,SCLK,LED N5110 lcd(PB_8,PA_4,PA_0,PA_1,PA_7,PA_5,PB_9); //PA_4 and PA_6 not used REnc encoder(PC_3, PC_2); +//PwmOut led(PA_3); +PwmOut green(LED1); int temperature = 50; void CCW_Handle(void) @@ -29,6 +32,17 @@ lcd.init(); encoder.setHandleCCW(CCW_Handle); encoder.setHandleCC(CW_Handle); + // led.period_us(100); + // led = 20; + green = 0.5; + green.period_ms(10); + while(1) { + green = green + 0.01; + wait(0.2); + if(green == 1.0) { + green = 0; + } + } // while(1) { // for (i=1; i<7; i++) {