Dimitar Marinov
/
Nucleo_4_encoders_w_Nokia5110
4 Rotary encoders with 5110 LCD display. For Nucleo boards
Diff: main.cpp
- Revision:
- 10:65e7ceb96b39
- Parent:
- 9:37975a517fb0
--- a/main.cpp Sun Oct 23 18:44:15 2016 +0000 +++ b/main.cpp Mon Oct 24 17:21:58 2016 +0000 @@ -31,8 +31,8 @@ #define __HAL_TIM_IS_TIM_COUNTING_DOWN(__HANDLE__) (((__HANDLE__)->Instance->CR1 &(TIM_CR1_DIR)) == (TIM_CR1_DIR)) #endif -TIM_Encoder_InitTypeDef encoder1, encoder2, encoder3, encoder4; -TIM_HandleTypeDef timer1, timer2, timer3, timer4; +TIM_Encoder_InitTypeDef encoder1, encoder2, encoder3, encoder4, encoder5; +TIM_HandleTypeDef timer1, timer2, timer3, timer4, timer5; //DigitalOut red(LED1); @@ -44,7 +44,9 @@ // VCC,SCE, RST, D/C, MOSI,SCLK,LED -N5110 lcd(PB_8,PA_4,PB_14,PB_9,PB_15,PB_13,PB_3); //PA_4 and PA_6 not used + +// N.C.,SCE, RST, D/C, MOSI,SCLK,N.C +N5110 lcd(PA_4,PA_4,PB_14,PB_9,PB_15,PB_13,PA_4); //PA_4 and PA_6 not used int temperature = 50; @@ -78,14 +80,14 @@ EncoderInit(&encoder4, &timer4, TIM4, 3600, TIM_ENCODERMODE_TI12); //TIM5 is used by mbed for systick - //EncoderInit(encoder2, timer2, TIM5, 0xffffffff, TIM_ENCODERMODE_TI12); +// EncoderInit(&encoder5, &timer5, TIM5, 0xffffffff, TIM_ENCODERMODE_TI12); // printf("STM HAL encoder demo\n\r"); // these are default settings so not strictly needed lcd.normalMode(); // normal colour mode - lcd.setBrightness(0.5); // put LED backlight on 50% - __HAL_TIM_SET_COUNTER(&timer2,0); + lcd.setBrightness(0.7); // put LED backlight on 50% + // __HAL_TIM_SET_COUNTER(&timer2,0); // can directly print strings at specified co-ordinates // lcd.printString("**STM Nucleo**",0,0);