Thanks, I figured it was something simple... I can't believe i missed that.
I also appreciate the style pointers. I'm learning as I go and I don't know this stuff unless someone tells me.
So now I'm running in to a problem with my byte array. Here's the code as it sits now:
MultiScreen.cpp
/*
This Code has extra features
including a XY positioning function on Display
and a Line Draw function on Nokia 3310 LCD
It is modded from the original
http://www.arduino.cc/playground/Code/PCD8544
*/
// Mods by Jim Park
// jim(^dOt^)buzz(^aT^)gmail(^dOt^)com
// hope it works for you
#include <nokia5110.h>
#define PIN_SCE 7 // LCD CS .... Pin 3
#define PIN_RESET 6 // LCD RST .... Pin 1
#define PIN_DC 5 // LCD Dat/Com. Pin 5
#define PIN_SDIN 4 // LCD SPIDat . Pin 6
#define PIN_SCLK 3 // LCD SPIClk . Pin 4
// LCD Gnd .... Pin 2
// LCD Vcc .... Pin 8
// LCD Vlcd ... Pin 7
nokia5110 LeftDisplay(PIN_SCE, PIN_RESET, PIN_DC, PIN_SDIN, PIN_SCLK);
void setup(void)
{
}
void loop(void)
{
// Display some simple character animation
//
int a,b;
char Str[15];
// Draw a Box
for(b=1000; b>0; b--){
LeftDisplay.drawBorderBox();
for(a=0; a<=5 ; a++){
LeftDisplay.gotoXY(2,1);
// Put text in Box
LeftDisplay.LcdString ("Left Front");
LeftDisplay.gotoXY(24,3);
LeftDisplay.LcdCharacter('H');
LeftDisplay.LcdCharacter('E');
LeftDisplay.LcdCharacter('L');
LeftDisplay.LcdCharacter('L');
LeftDisplay.LcdCharacter('O');
LeftDisplay.LcdCharacter(' ');
LeftDisplay.LcdCharacter('=');
// Draw + at this position
LeftDisplay.gotoXY(10,3);
LeftDisplay.LcdCharacter('=');
delay(250);
LeftDisplay.gotoXY(24,3);
LeftDisplay.LcdCharacter('h');
LeftDisplay.LcdCharacter('e');
LeftDisplay.LcdCharacter('l');
LeftDisplay.LcdCharacter('l');
LeftDisplay.LcdCharacter('o');
LeftDisplay.LcdCharacter(' ');
LeftDisplay.LcdCharacter('-');
// Draw - at this position
LeftDisplay.gotoXY(10,3);
LeftDisplay.LcdCharacter('-');
delay(250);
}
}
}
Here's the header:
/*
nokia5110.h
This file contains the functions and data required
to drive several Nokia 5110 LCD displays.
*/
#ifndef nokia5110_h
#define nokia5110_h
#include "Arduino.h"
class nokia5110
{
public:
nokia5110(int SCE, int RESET, int DC, int SDIN, int SCLK);
void drawBorderBox();
void gotoXY(int x, int y);
void LcdWrite(byte dc, byte data);
void LcdClear();
void LcdString(char *charachters);
void LcdCharacter(char charachter);
private:
int _SCE;
int _RESET;
int _DC;
int _SDIN;
int _SCLK;
static byte ASCII[][5];
};
#endif