3rd year group project. Electronic and Electrical Engineering. Heriot-Watt University. This is the code for the mbed for the Automatic Little Object Organiser (ALOO).

Dependencies:   MCP23017 TCS3472_I2C WattBob_TextLCD mbed

main.cpp

Committer:
dreamselec
Date:
2015-10-29
Revision:
1:92a2a5ef65a8
Parent:
0:fe5cb0a8fc5a
Child:
2:7a55cb10259f

File content as of revision 1:92a2a5ef65a8:

#include "mbed.h"
#include "WattBob_TextLCD.h"
#include "TCS3472_I2C.h"
#include "MCP23017.h"
#include <string>
#include <time.h>

#define BACKLIGHT_ON(INTERFACE) INTERFACE->write_bit(1, 4);
#define BACKLIGHT_OFF(INTERFACE) INTERFACE->write_bit(0, 4);

#define PRINT_LCD(TEXT) lcd->printf(TEXT);
#define CLEAR_LCD() lcd->cls();
#define LCDFL() lcd->locate(0,0);
#define LCDSL() lcd->locate(1,0);
#define CLEAR_LEDS() i2cport->write_bit(0, 12); i2cport->write_bit(0, 13); i2cport->write_bit(0, 14); i2cport->write_bit(0, 15);

DigitalOut myled(LED1);

MCP23017 *i2cport;
WattBob_TextLCD *lcd;

 TCS3472_I2C rgb_sensor(p28, p27);
 Serial      pc(USBTX, USBRX);

int main(){
        i2cport = new MCP23017(p9, p10, 0x40);
        lcd = new WattBob_TextLCD(i2cport);
        BACKLIGHT_ON(i2cport);
        int rgb_results[4];
        pc.baud(19200);
        srand((unsigned)time(NULL));
        
}