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
Diff: FPGAcomms.h
- Revision:
- 11:06f6e82b40a8
- Parent:
- 10:8c0696b99692
- Child:
- 12:814a8fdbb6f7
--- a/FPGAcomms.h Wed Nov 12 20:14:45 2014 +0000
+++ b/FPGAcomms.h Thu Nov 13 11:59:39 2014 +0000
@@ -1,5 +1,6 @@
#include "mbed.h"
-#include "Colour.h"
+//#include "Colour.h"
+#include "colourProcessing.h"
//Setup pins to FPGA
DigitalOut startSort(p5); //A positive edge tells the FPGA to start sorting.
DigitalIn sortComplete(p16);
@@ -68,12 +69,12 @@
//wait(1); //temporary delay
while(!dispenseComplete){
- wait(0.1);
+ wait(0.2);
log("Waiting for dispense complete");
printLCD("Waiting for dispense complete");
}
- wait(0.1);
+ wait(0.5);
log("Complete");
log("Setting start dispense to false");
startDispense = false;
@@ -117,6 +118,20 @@
colourBit3 = false;
break;
+ case BIN:
+ log("Sort BIN");
+ log("Setting sort bits to 011");
+ colourBit1 = true;
+ colourBit2 = true;
+ colourBit3 = false;
+ break;
+ case RECYCLE:
+ log("Recycle");
+ log("Setting sort bits to 100");
+ colourBit1 = false;
+ colourBit2 = false;
+ colourBit3 = true;
+ break;
}
@@ -126,16 +141,16 @@
//wait(1); //temporary delay
while(!sortComplete){
- wait(0.1);
+ wait(0.5);
log("Waiting for sort complete");
printLCD("Waiting for sort complete");
}
log("Complete");
- wait(0.1);
+ wait(0.5);
log("Setting start sort to false");
- startSort = false;
+ startSort = false;
log("Resetting dispense bits to 11");
colourBit1 = true; //reset the dispense select to do nothing
