Author Topic: Sample Code shows tester_init.h what is it  (Read 5182 times)

FrancoArdito

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Sample Code shows tester_init.h what is it
« on: October 24, 2014, 10:26:00 AM »
I am a newbee to the world of Microcontrollers.
I have a NHD-0216K3Z-NS(RGB)-FBW-V3 that I am trying to use in my project.
I looked at the sample code for Serial LCD on the web site and I see this line in the code
                      #include "e:\2321_tester\tester_init.h"
What does it contain or where can I get a copy?

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: Sample Code shows tester_init.h what is it
« Reply #1 on: October 24, 2014, 02:22:46 PM »
That file is unavailable and is not relevant for the example code for the display.  I have included below another example program written for the Arduino, this should help you get this display working:

Code: [Select]
//---------------------------------------------------------
/*
NHD_0216K3Z_mega.ino
Program for writing to Newhaven Display 2 x 16 (K3Z) Character LCD with PIC16F690 controller

(c)2014 Mike LaVine - Newhaven Display International, LLC.

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
*/
//---------------------------------------------------------

#include <Wire.h>

int ASDA = 20;      // SDA signal connected to pin 20 (SDA) of Arduino Mega 2560
int ASCL = 21;      // SCL signal connected to pin 21 (SCL) of Arduino Mega 2560

unsigned char text1[]={"Newhaven Display"};
unsigned char text2[]={" International  "};

unsigned char tx_packet[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);

const char slave2w = 0x28;   //0x50 shifted over 1 bit

void send_packet(unsigned char x)
{
  unsigned char ix;
  Wire.beginTransmission(slave2w);
  for(ix=0;ix<x;ix++)
  {
    Wire.write(tx_packet[ix]);
  }
  Wire.endTransmission();
}

void lcd_cursor(unsigned int x)
{
  tx_packet[0] = 0xFE;
  tx_packet[1] = 0x45;
  tx_packet[2] = x;
  send_packet(3);
}

void lcd_clear(void)
{
  tx_packet[0] = 0xFE;
  tx_packet[1] = 0x51;
  send_packet(2);
}

void setup()       //runs first when powered on
{
  pinMode(ASCL, OUTPUT);      //set Arduino I2C lines as outputs
  pinMode(ASDA, OUTPUT);      //
  digitalWrite(ASCL, LOW);    //
  digitalWrite(ASDA, LOW);    //
  delay(100);    //100ms delay
}

void loop()
{
  Wire.begin();             //initialize Arduino I2C
  TWBR = 152;               //change Arduino Mega 2560 I2C clock frequency from 100kHz to 50kHz
  lcd_clear();
 
  tx_packet[0] = 0xFE;
  tx_packet[1] = 0x52;
  tx_packet[2] = 40;        //contrast 1 - 50
  send_packet(3);
 
  tx_packet[1] = 0x53;     
  tx_packet[2] = 15;        //backlight 1 - 15
  send_packet(3);
 
  tx_packet[1] = 0x48;      //underline cursor off
  send_packet(2);
 
  tx_packet[1] = 0x46;      //cursor home
  send_packet(2);
 
  delay(250);
 
  while(1)
  {
  for(unsigned char i=0;i<16;i++)
  {
    tx_packet[i] = text1[i];
  }
  send_packet(16);
 
  lcd_cursor(0x40);
  delay(100);  //100ms delay
 
  for(unsigned char i=0;i<16;i++)
  {
    tx_packet[i] = text2[i];
  }
  send_packet(16);
  delay(1000);
  }
}

FrancoArdito

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Sample Code shows tester_init.h what is it
« Reply #2 on: October 24, 2014, 05:27:34 PM »
Michael_L thank you  for the reply. The code you sent gave me some insight to how to use the LCD display.

The chip I am using is the PIC 18F14K22 so I guess I will figure it out.

 

NHD‐0420CW‐AG3 + I2C + PIC assembly code: trouble getting started

Started by RichardRBoard OLEDs

Replies: 4
Views: 3168
Last post December 17, 2015, 03:12:49 AM
by RichardR
Korean Hex GB code for OLED multi font display NHD-2.7-12864UMY3

Started by newhavenuserBoard OLEDs

Replies: 2
Views: 683
Last post Today at 08:54:12 AM
by tolikkk
Use of Timing characteristics in the initialization code of the display

Started by ShabdaBoard TFTs

Replies: 1
Views: 2942
Last post May 20, 2014, 08:00:39 AM
by Michael_L
NHD-5.0-800480TF-ATXL linux driver code

Started by carlovalBoard TFTs

Replies: 1
Views: 2275
Last post March 27, 2015, 08:20:26 AM
by Paul_B
Initialization code for M0220SD-202SDAR1 module??

Started by Javier OrtizBoard Vacuum Fluorescent Displays

Replies: 1
Views: 2534
Last post November 17, 2015, 05:12:51 PM
by Saurabh_B