Getting Started

(lily) #1

Chapter 11 The Butterfly LCD


o Send “Called SetContrast to the PC where # is the decimal number
sent.

NOTE: In LCD_driver.c must comment out #include “main.h”


Now that we have our specification we can run off willy-nilly and write the
software.


We write the Demonstrator.h file:


// Demonstrator.h LCD demo version
void initializer(void);
void parseInput(char *);


include "Demonstrator.h"

DEMO[] PROGMEM = "'LCD' demo.\r\r\0";

And the Demonstrator.c file:


// Demonstrator.c LCD demo version


#include "PC_Comm.h"



#include "LCD_test.h"
#include "LCD_driver.h"
#include "LCD_functions.h"


// identify yourself specifically
const char TALKINGTO[] PROGMEM = "\r\rYou are talking to the \0";
const char WHO


// bad command
const char BAD_COMMAND1[] PROGMEM = "\rYou sent: '\0";
const char BAD_COMMAND2[] PROGMEM = "' - I don't understand.\r\0";


const char LCD_START_msg[] PROGMEM = "LCD demo\0";


void initializer()
{
// Calibrate the oscillator:
OSCCAL_calibration();


// Initialize the USART
USARTinit();


// initialize the LCD
LCD_Init();


// Display instructions on PC

Free download pdf