first take

Dependencies:   TextLCD mbed

Fork of TextLCD_HelloWorld by Simon Ford

main.cpp

Committer:
jn80842
Date:
2014-11-03
Revision:
3:dfdc05f63423
Parent:
2:ad0b044d0a10

File content as of revision 3:dfdc05f63423:

#include "mbed.h"
#include "TextLCD.h"

DigitalOut led1(LED1);

TextLCD lcd(D11,D10,D3,D2,D1,D0,TextLCD::LCD20x4);

DigitalIn sda(PTE0);
DigitalIn scl(PTE1);
I2CSlave slave(PTE0, PTE1);
//AnalogIn vol(A0);

//const int addr = 0x90;
char cmd[2];
//slave.address = addr;


int main() {
    led1=1;
    sda.mode(PullUp);
    scl.mode(PullUp);
    cmd[0] = '?';
    cmd[1] = '!';
    slave.address(0x90);
    while(true) {
        led1=!led1;
        //float val = 3.3*vol;
        slave.read(cmd,2);
        lcd.printf("Toastboard!\n");
        lcd.printf("%s\n",cmd);
        wait(1);
        }
        
}