User Tools

Site Tools


arduino:displays_for_classic_arduinos:display_nokia_5110_u8g2_counter.ino

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
arduino:displays_for_classic_arduinos:display_nokia_5110_u8g2_counter.ino [2018/01/28 04:36] – created mithatarduino:displays_for_classic_arduinos:display_nokia_5110_u8g2_counter.ino [2018/04/23 16:16] (current) mithat
Line 1: Line 1:
 <file c++ display_nokia_5110_u8g2_counter.ino> <file c++ display_nokia_5110_u8g2_counter.ino>
-#include <U8g2lib.h> 
- 
 /* /*
- *  display_nokia_5110_u8g2_counter.ino +   display_nokia_5110_u8g2_counter.ino 
- *   +   Mithat Konar 
- Test screen update speed with large solid fonts on  +     
- a Nokia 5110 screen that uses the PCD8544 controller. +   Test screen update speed with large solid fonts on  
-  +   a Nokia 5110 screen that uses the PCD8544 controller. 
- Notes: +    
- Consumes 42% of program storage space and +   Notes: 
- 24% of dynamic memory on a Pro Mini.+   Consumes 42% of program storage space and 
 +   24% of dynamic memory on a Pro Mini
 + 
 +   String storage may not be not optimized. 
 +    
 +   Frame rate without additional LOOP_DELAY is about 
 +   10 fps with 8MHz processor.
  */  */
  
Line 24: Line 28:
  * GND: ground  * GND: ground
  */  */
 +
 +#include <U8g2lib.h>
  
 const unsigned int CLOCK_PIN = 13, const unsigned int CLOCK_PIN = 13,
Line 31: Line 37:
                    RESET_PIN = 8;                    RESET_PIN = 8;
  
-//U8G2_PCD8544_84X48_1_4W_SW_SPI u8g2 = U8G2_PCD8544_84X48_1_4W_SW_SPI(U8G2_R0, CLOCK_PIN, DATA_PIN, CS_PIN, DC_PIN, RESET_PIN);  // SW SPI +U8G2_PCD8544_84X48_1_4W_HW_SPI disp(U8G2_R0, CS_PIN, DC_PIN, RESET_PIN);  // HW SPI
-U8G2_PCD8544_84X48_1_4W_HW_SPI disp = U8G2_PCD8544_84X48_1_4W_HW_SPI(U8G2_R0, CS_PIN, DC_PIN, RESET_PIN);                       // HW SPI+
  
 unsigned int counter = 80; unsigned int counter = 80;
 char dispStr[4];    // null terminated char array used to pass to renderer. char dispStr[4];    // null terminated char array used to pass to renderer.
 +const unsigned int LOOP_DELAY = 500; // msec of additional loop delay
  
 void setup(void) { void setup(void) {
Line 55: Line 61:
     String(counter).toCharArray(dispStr, 4);     String(counter).toCharArray(dispStr, 4);
     disp.drawStr( 0, 47, dispStr);     disp.drawStr( 0, 47, dispStr);
-  } while ( disp.nextPage() );+  } while (disp.nextPage());
  
-  /* inherent frame rate is about 10 fps with 8MHz processor  +//  delay(LOOP_DELAY);
-     (without additional delay). */ +
-  delay(500);+
 } }
-</file>  +</file>
arduino/displays_for_classic_arduinos/display_nokia_5110_u8g2_counter.ino.1517114173.txt.gz · Last modified: 2018/01/28 04:36 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki