Pages: [1]   Go Down
Author Topic: brightness control for Noritake LCD-compatible VFD  (Read 4151 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a suggestion for an addition to the LiquidCrystal library:

LiquidCrystal.cpp diff:
Code:
255,270d254
< // set dimming on Noritake LCD-compatible VFD
< // dimming levels:
< // 0 = 100%
< // 1 = 75%
< // 2 = 50%
< // 3 = 25%
< void LiquidCrystal::vfdDim(uint8_t dimming) {
<       if ((dimming > -1) && (dimming < 4)) {
<             digitalWrite(_rw_pin, LOW);
<             send(0x28, LOW);
<             digitalWrite(_rw_pin, HIGH);
<             send(dimming, HIGH);
<             digitalWrite(_rw_pin, LOW);
<       }
< }
<

LiquidCrystal.h diff:
Code:
79d78
<   void vfdDim(uint8_t dimming);

Usage example code - alternates between 100% and 25% brightness  every second:
Code:
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 2);
  // Print a message to the LCD.
  lcd.vfdDim(3);
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
  if (((millis()/1000) % 2) == 0)
  {
    lcd.vfdDim(0);
  }
  else
  {
    lcd.vfdDim(3);
  }
}

Tested on a Noritake CU20029ECPB-W1J

VFDs rock!  smiley
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have found this code useful, thank you!

Tested on a CU20025ECPB-W1J as working.
Logged

Pages: [1]   Go Up
Jump to: