Library for the serial LCD-09396 of Sparkfun

Dependents:   M5VelocityALLCODE

Fork of SerLCDv25 by Beeli Nick

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SertLCDv25.cpp Source File

SertLCDv25.cpp

00001 #include "mbed.h"
00002 #include "SerLCDv25.h"
00003 
00004 
00005 
00006 SerLCDv25::SerLCDv25(PinName rx, PinName tx) {
00007     device = new Serial(rx, tx);
00008 }
00009 
00010 
00011 void SerLCDv25::clear() {
00012     device->printf("%c%c",0xFE,0x01);
00013 }
00014 void SerLCDv25::cursorUnderline() {
00015     device->printf("%c%c",0xFE,0x0E);
00016 }
00017 void SerLCDv25::cursorBlinkingBox() {
00018     device->printf("%c%c",0xFE,0x0D);
00019 }
00020 void SerLCDv25::cursorClear() {
00021     device->printf("%c%c",0xFE,0x0C);
00022 }
00023 void SerLCDv25::displayON() {
00024     device->printf("%c%c",0xFE,0x0C);
00025 }
00026 void SerLCDv25::displayOFF() {
00027     device->printf("%c%c",0xFE,0x08);
00028 }
00029 void SerLCDv25::printf(char *string) {
00030     device->printf("%s",string);
00031 }
00032 void SerLCDv25::printValue(float *Value) {
00033     device->printf("%4.2f",*Value);
00034 }
00035 void SerLCDv25::putc(char lettre) {
00036     device->printf("%c",lettre);
00037 }
00038 void SerLCDv25::Brightness(int Value) {
00039     if (Value<0) {
00040         Value=0;
00041     }
00042     if (Value>100) {
00043         Value=100;
00044     }
00045     Value=Value*29/100+128;
00046     device->printf("%c%c",0x7C,Value);
00047 }
00048 
00049 
00050 void SerLCDv25::splash(){
00051     device->printf("%c%c",0x7C,0x0a);
00052 }
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060