Pages: [1]   Go Down
Author Topic: Help with this code to blink the LCD screen on my MEGA. Please help....  (Read 423 times)
0 Members and 1 Guest are viewing this topic.
JoCo N.C. USA
Offline Offline
Jr. Member
**
Karma: 1
Posts: 72
Don't know jack, but want to know it all..... Let the journey begin!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I am trying to get my MEGA with LCD to blink the screen. Below is the code, it is not working...It gets two errors when I check it, it will not let me copy and paste them for some reason.  smiley-red Thanks for any help. Steve


/*
Modified by Lauren
version 0.3

Any suggestions are welcome.
E-mail: Lauran.pan@gmail.com

Editor     : Lauren from DFRobot
Date       : 06.01.2012

=¡£=

* Have the back light under control.
* Update the library and sketch to compatible with IDE V1.0 and earlier

*/

#ifndef LCD4884_h
#define LCD4884_h

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

#define SPI_SCK 2
#define SPI_MOSI 3
#define LCD_DC  4
#define SPI_CS  5
#define LCD_RST 6
#define LCD_BL  7


//display mode -- normal / highlight
#define MENU_NORMAL   0
#define MENU_HIGHLIGHT 1
#define OFF 0
#define ON 1


class LCD4884
{
public:
LCD4884();
void LCD_init(void);
void backlight(unsigned char dat);
void LCD_write_byte(unsigned char dat, unsigned char dat_type);
void LCD_draw_bmp_pixel(unsigned char X,unsigned char Y,unsigned char *map,unsigned char Pix_x,unsigned char Pix_y);
void LCD_write_string(unsigned char X,unsigned char Y,char *s, char mode);      
void LCD_write_chinese(unsigned char X, unsigned char Y,unsigned char *c,unsigned char ch_with,unsigned char num,unsigned char line,unsigned char row);
void LCD_write_string_big ( unsigned char X,unsigned char Y, char *string, char mode );
void LCD_write_char_big (unsigned char X,unsigned char Y, unsigned char ch, char mode);
void LCD_write_char(unsigned char c, char mode);
void LCD_set_XY(unsigned char X, unsigned char Y);
void LCD_clear(void);
};
extern LCD4884 lcd;  
              
#endif   //
Logged

The geeks shall inherit the Earth!

Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2943
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Uhhh, where is your code?

void setup() {
.
.
.
}

void loop(){
.
.
.
.
}

--other functions--
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

JoCo N.C. USA
Offline Offline
Jr. Member
**
Karma: 1
Posts: 72
Don't know jack, but want to know it all..... Let the journey begin!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

WTF! I just noticed that now that you mention it, duh! It was the Fleabay seller that emailed me that. Can you fix it by just plugging the missing code in, or is it all wrong? I am VERY new to Arduino coding. Thanks, karma given, Steve.
Logged

The geeks shall inherit the Earth!

Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2943
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you can get the missing code, it may work. There is a LCD example code you can try under, Files/ Examples/ LiquidCrystal. Make sure your pins are correctly wired.
« Last Edit: January 11, 2013, 02:26:53 pm by HazardsMind » Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

JoCo N.C. USA
Offline Offline
Jr. Member
**
Karma: 1
Posts: 72
Don't know jack, but want to know it all..... Let the journey begin!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah that's where I started, but it is a different LCD then what came with my MEGA and so I wrote to the seller and asked for some code and they sent me that. I guess I am going to have to message them back. Thanks anyway, maybe someone else will know. Coding is not my thing (yet)
Logged

The geeks shall inherit the Earth!

Saskatchewan
Offline Offline
Sr. Member
****
Karma: 15
Posts: 348
When the going gets weird, the weird turn pro. - Hunter S. Thompson
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks to me like your guy sent you a library. It's up to you to wrap it with some code to do what you want. What you want will likely be a cross between blink without delay and the method that library has for controlling the backlight.

Would it be accurate to guess that you have two files  LCD4884.h and  LCD4884.cpp?
Logged

JoCo N.C. USA
Offline Offline
Jr. Member
**
Karma: 1
Posts: 72
Don't know jack, but want to know it all..... Let the journey begin!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes Jimmy, that's right! Hey if I am having this much trouble getting the thing to blink will I ever get it to print and or interface?
Logged

The geeks shall inherit the Earth!

Pages: [1]   Go Up
Jump to: