Will Salisbury / VFD
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers VFD.h Source File

VFD.h

00001 /*
00002  * File: VfD/VFD.h
00003  * Author: William Jessup Salisbury
00004  * Company: Tufts Hybrid Racing Team
00005  * Copyright: CC BY-NC-SA 3.0
00006  * Date: 3/11/2012
00007  */
00008 
00009 #ifndef VFD_H
00010 #define VFD_H
00011 
00012 #include "mbed.h"
00013 #include <string>
00014 
00015 const PinName SDA = p28;
00016 const PinName SCL = p27;
00017 const int address = 0x50;
00018 
00019 class VFD {
00020 public:
00021     VFD();
00022     ~VFD();
00023     void start(void);
00024     void stop(void);
00025     int send_byte(int byte);
00026     int read_byte(int ack);
00027     int init();
00028     int print(const string msg);
00029     int autoScrollOn();
00030     int autoScrollOff();
00031     int lineWrapOn();
00032     int lineWrapOff();
00033     int setCursor(const int col, const int row);
00034     int clearScreen();
00035     int goHome();
00036     int initLargeNumbers();
00037     int setBrightness(const int val);
00038 private:
00039     I2C _i2c;
00040     int write(const char * data, int length);
00041     int read(char * data, int length);
00042 };
00043 
00044 #endif