Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MCP23017 TCS3472_I2C WattBob_TextLCD mbed-rtos mbed
main.cpp
- Committer:
- IonSystems
- Date:
- 2014-11-07
- Revision:
- 6:e64796f1f384
- Parent:
- 5:644bca33c1ca
- Child:
- 7:6ba00694f9cd
File content as of revision 6:e64796f1f384:
#include "mbed.h"
#include <sstream>
#include "lcdCommands.h"
#include "mbedStorage.h"
#include "rgbLED.h"
#include "mbedLCD.h"
Serial pc(USBTX, USBRX);
//Boolean values to easily enable and disable certain features for individual testing
bool colourSensor   =   true;
bool cardReader     =   true;
bool sorter         =   true;
bool dispensor      =   true;
bool cardDataAcquired   = false;
bool colourDataAcquired = false;
bool chipDetected       = false;
bool operationMode      = true; //the MBED starts in operation mode.
      
int main() { 
writeFile(2,6,22);
readChipNumbers();
setupLCD();
printLCD("Welcome to the  Chipin Sorter");
wait(1);
printStoredChipValues();
/*     
    while(1){
       if(par_port->read_bit(11)) resetForNextCustomer();
       // char c = pc.getc(); //wait for a serial character to be recieved.
       // processMessage(c);  //Do something, based on the character recieved.
        if(cardDetect & !cardDataAcquired) cardAcquisition();
        setLEDs();
        readButtons();
        
        if(chipDetected & !colourDataAcquired){
            Colour colour = readColourSensor();
            sendColourSignal(colour);
        }
        
        writeFile(redQueue, greenQueue, blueQueue);
        readFile();
        wait(2);
        
        }
    */
    
    setLEDcolour(255,0,0);
    wait(0.1);
    setLEDcolour(0,255,0);
     wait(0.1);
    setLEDcolour(0,0,255);
    wait(0.1);
    
    displayOperationMode();    
    }
            
    