Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Chris O.

Pages: 1 2 [3]
31
OLEDs / Re: Library that works fine on the NHD-0420CW-A*3
« on: March 22, 2015, 07:03:52 PM »
Liquid Crystal Display Custom Character Designer

http://mikeyancey.com/hamcalc/lcd_characters.php

32
OLEDs / Re: Library that works fine on the NHD-0420CW-A*3
« on: March 22, 2015, 06:52:13 PM »
Two Custom Characters
Code: [Select]

#include <OLEDFourBit.h> //  NewHAVEN NHD-0420DZW-AY5-ND
//#include <LiquidCrystal.h>
OLEDFourBit lcd(7, 4, 10, 5, A3, A4, A5);
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

byte newChar1[8] = {
  B00000,
  B00000,
  B10101,
  B11101,
  B11101,
  B10101,
  B00000,
  B00000
};

byte newChar2[8] = {
  B10000,
  B01000,
  B00101,
  B00100,
  B00100,
  B00101,
  B01000,
  B10000
};

void setup() {
  lcd.createChar(0, newChar1);
  lcd.createChar(1, newChar2);
  lcd.begin(20, 4);
 

}
void loop() {
  lcd.setCursor(2,0);
  lcd.write(0); //PRINT
  lcd.setCursor(2,1);
  lcd.write(1); //PRINT

  delay(1000);
}

33
OLEDs / Re: Library that works fine on the NHD-0420CW-A*3
« on: March 22, 2015, 06:13:15 PM »
Hmm ok
Can you try this.

Code: [Select]
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

byte newChar[8] = {
        B00000,
        B00000,
        B10101,
        B11101,
        B11101,
        B10101,
        B00000,
        B00000
};

void setup() {
    lcd.createChar(0, newChar);
    lcd.begin(20, 4);
    lcd.write(0);
}

void loop() {}

34
OLEDs / Re: Library that works fine on the NHD-0420CW-A*3
« on: March 20, 2015, 10:36:35 PM »
Quote
The only missing function, at least one I'd like to see is a custom character. Most controllers allow for this, and the NHD420CW does. Just not in this library. And I speak entirely about Arduino Uno. But it is doing what I needed, with the exception of needing 8 custom characters I need to represent with letters. I tried adding it but while I think I got the character creation right, for all I've looked, I cannot see how to select a custom character (anybody give me a pointer on THAT??

Hi
I hope this will help.
It's for my arduino-matrixorbital
A software emulator for Matrix Orbital character display commands on Arduino.
Example sketch that uses Matrix Orbital type commands, look at case 78: // Define custom character

Code: [Select]
#include <OLEDFourBit.h> // Works with NewHAVEN NHD-0420DZW-AY5-ND
// Added fixes by Chris O. to OLEDFourBit library, Compatibility with previous versions of IDE. NOTE tested on Aduino 023 IDE <---> Aduino 1.0.4 IDE
// NOTE: Arduino Micro Pin Mapping i used.
OLEDFourBit lcd(12, A0, A1, A2, A3, A4, A5); //with rw pin (12, 11, 10, 5, 4, 3, 2);
//OLEDFourBit lcd(12, 14, 15, 16, 17, 18, 19);

// these constants won't change.  But you can change the size of
// your LCD using them:
const int numRows = 4; // 4x20 LCD
const int numCols = 20;
//
byte rxbyte = 0; // incoming data storage

void setup() {
  Serial.begin(19200); // Default baudrate.
  lcd.begin(numCols, numRows); // Change this for other screen sizes. 
  lcd.print("Arduino Emulator for");
  lcd.setCursor(1, 1);
  lcd.print("Matrix Orbital!");
  lcd.setCursor(2, 2);
  lcd.print("Character Display!");
  lcd.command(0b00010000); //Moves the cursor back one space before the blinking cursor
  lcd.command(0b00001101); // 0b00001DCB Show Blinking Block Cursor with out Underscore

  delay(5000); //delay 5 sec
  // while (serial_getch() == 0 ){   //delay [ Wait for OS to load ]
  //   rxbyte = serial_getch();
  //}
  lcd.command(0b00001100); //Turn off the blinking cursor: on exit
  //lcd.noBlink(); // Turn off the blinking cursor: on exit / no good it will turn off the display ????????? lib. problem?

  lcd.clear(); // clear the screen
  lcd.setCursor(0,0);
}
void loop() {
  // incoming data storage
  byte temp; // Parameter storage
  byte temp2; //2nd Parameter storage

  rxbyte = serial_getch(); //get byte and store in rxbyte

  if (rxbyte == 254) { //Matrix Orbital uses 254 prefix for commands
    switch (serial_getch()) { //get byte

    case 71:  //set cursor position
      temp = (serial_getch() - 1);  //get column byte
      switch (serial_getch())  //get row byte
      {
        //line 1 is already set up
      case 2:
        temp += 0x40;
        break;
      case 3:
        temp += 0x14;
        break;
      case 4:
        temp += 0x54;
        break;
      default:
        break;
      }
      lcd.command(0b10000000 + temp);
      delay(1);
      break;

    case 72: // Cursor home (doesn't clear the screen!)
      //lcd.home();
      lcd.setCursor(0,0);
      break;

    case 76: // Move cursor left  0b00010000 / dec16 /hex10
      lcd.command(16);//Cursor/Display Shift  hex(0x10); //set cursor position one character to the left
      break;

    case 77: // Move cursor right 0b00010100 / dec20 /hex14
      lcd.command(20);
      break;

    case 78: // Define custom character (2 parameters, id, data)
      lcd.command(64 + (serial_getch() * 8));
      for (temp = 8; temp != 0; temp--) {
        lcd.write(serial_getch()); //works with Adafruit_CharacterOLED library
      }
      break;
    }
    return; // Stop and start again.
  }

  // Otherwise its a plain char so we print it to the LCD.
  //lcd.write(rxbyte);
  lcd.print((char)rxbyte);  //otherwise a plain char so we print it to lcd
} // END of main loop

// ***********************************************************************************************************
// *           Get byte
// *             
// *           Waits for a byte to be available, reads and returns it.
// *
// ***********************************************************************************************************
byte serial_getch() { // Get byte from Serial
  while (Serial.available() == 0);
  return Serial.read();
}

NOTE: This is not a complete code its missing many commands.

35
OLEDs / Re: NHD-0420DZW-AB5 SPI Clarification
« on: December 05, 2014, 09:38:48 PM »
Hi
I'm a happy user of the Newhaven-NHD-0420DZW-AY5.
But i use this datasheets http://www.adafruit.com/datasheets/WS0010.pdf

The main differences in the instructions.
1) Has a Character mode and a Graphic Mode so it requires one additional step to specify the mode which it runs in.
2) The "Function Set" instruction requires you to specify which Font Tables (2 available) to use.
3) Has a Bit in one of the instructions to allow you to turn enable/disable the internal power, Embedded DC-DC voltage converter ,Brightness DIM/FULL  :)

I'm not 100% sure if Newhaven Display use ( WS0010 OLED ) Driver/Controller IC utilizing CMOS Technology specially designed to display
alphanumeric and Japanese kana characters as well as symbols and graphics.
But i did get the Brightness DIM/FULL  control by going in the graphic mode and set the internal power ON/OFF.

I hope this helps.
Chris O.
 ;)

Pages: 1 2 [3]