User Tools

Site Tools


arduino:displays_for_classic_arduinos:display_96x68_hx1230.ino
display_96x68_HX1230.ino
/*
   display_96x68_HX1230.ino
   Mithat Konar
 
   Test screen update speed with large solid fonts on 
   a 96x68 screen that uses the HX1230 controller.
 
   Notes:
   Consumes 41% of program storage space and
   26% of dynamic memory on a Pro Mini.
 
   String storage may not be not optimized.
 
   Frame rate without additional LOOP_DELAY is about
   1.2 fps with 8MHz processor.
 */
 
/*
 * Pin assignments:
 * RST: 8
 * CE/CS/SCE: 10
 * DC/"D/C": 9
 * DIN/DN/MOSI/DATA: 11
 * CLK/SCLK/SCK: 13
 * VCC: 3.3V
 * LIGHT/LED: ground through 330 ohm resistor
 * GND: ground
 */
 
#include <U8g2lib.h>
 
const unsigned int CLOCK_PIN = 13,
                   DATA_PIN = 11,
                   CS_PIN = 10,
                   DC_PIN = 9,
                   RESET_PIN = 8;
 
U8G2_HX1230_96X68_1_3W_SW_SPI disp(U8G2_R0, CLOCK_PIN, DATA_PIN, CS_PIN, RESET_PIN);
 
unsigned int counter = 80;
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) {
  disp.begin();
  disp.setContrast(64);
  disp.setColorIndex(1);
}
 
void loop(void) {
  counter = (counter + 1) % 1000;
 
  // picture loop
  disp.firstPage();
  do {  
    disp.setFont(u8g2_font_5x8_tr);
    disp.drawStr(0, 6, "HX1230 u8g2");
 
    disp.setFont(u8g2_font_logisoso38_tr);
    String(counter).toCharArray(dispStr, 4);
    disp.drawStr( 0, 47, dispStr);
  } while (disp.nextPage());
 
//  delay(LOOP_DELA/Y);
}
arduino/displays_for_classic_arduinos/display_96x68_hx1230.ino.txt · Last modified: 2018/04/23 16:17 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki