Demo for STM32F103C8T6 with a Nokia 5110 LCD.

Dependencies:   mbed N5110

Nokia 5110 LCD driven by STM32F103C8T6 board

This is a fork of Craig Evans' example program using his N5110 library.

Schematic

/media/uploads/hudakz/stm32f103c8t6_nokia5110_02.png

Wiring

STM32F103C8T6Nokia 5110
GND<=>GND
PA_10<R1>LIGHT
PA_9<=>VCC
PB_3<=>CLK
PB_5<=>DIN
PA_15<=>DC
PA_11<=>CE
PA_12<=>RST
Revision:
1:a5480500307f
Parent:
0:1be8870a132e
--- a/main.cpp	Sat Jan 14 22:38:52 2017 +0000
+++ b/main.cpp	Tue Feb 05 13:51:11 2019 +0000
@@ -1,7 +1,6 @@
 /*
  * Nokia 5110 LCD demo
  */
-#include "stm32f103c8t6.h"
 #include "mbed.h"
 #include "N5110.h"
  
@@ -9,7 +8,6 @@
 
 int main()
 {
-    confSysClock();     // configure system clock (72MHz HSE clock, 48MHz USB clock)   
     lcd.init();         // first need to initialise display
  
     while(1) {
@@ -77,9 +75,9 @@
         lcd.clear();
  
         // example of how to draw circles
-        lcd.drawCircle(WIDTH/2,HEIGHT/2,20,1);  // x,y,radius,black fill
-        lcd.drawCircle(WIDTH/2,HEIGHT/2,10,2);  // x,y,radius,white fill
-        lcd.drawCircle(WIDTH/2,HEIGHT/2,30,0);  // x,y,radius,transparent with outline
+        lcd.drawCircle(WIDTH/2,HEIGHT/2,20,FILL_BLACK);  // x,y,radius,black fill
+        lcd.drawCircle(WIDTH/2,HEIGHT/2,10,FILL_WHITE);  // x,y,radius,white fill
+        lcd.drawCircle(WIDTH/2,HEIGHT/2,30,FILL_TRANSPARENT);  // x,y,radius,transparent with outline
         lcd.refresh();   // need to refresh screen after drawing circles
  
         wait(5.0);
@@ -87,9 +85,9 @@
  
         // example of how to draw rectangles
         //          origin x,y,width,height,type
-        lcd.drawRect(10,10,50,30,1);  // filled black rectangle
-        lcd.drawRect(15,15,20,10,2);  // filled white rectange (no outline)
-        lcd.drawRect(2,2,70,40,0);    // transparent, just outline
+        lcd.drawRect(10,10,50,30,FILL_BLACK);  // filled black rectangle
+        lcd.drawRect(15,15,20,10,FILL_WHITE);  // filled white rectange (no outline)
+        lcd.drawRect(2,2,70,40,FILL_TRANSPARENT);    // transparent, just outline
         lcd.refresh();   // need to refresh screen after drawing rects
   
         wait(5.0);