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.
Diff: main.cpp
- Revision:
- 1:e4320a230347
- Parent:
- 0:c3344ac96db1
diff -r c3344ac96db1 -r e4320a230347 main.cpp --- a/main.cpp Thu Mar 14 12:53:00 2019 +0000 +++ b/main.cpp Mon Mar 18 11:04:39 2019 +0000 @@ -6,38 +6,36 @@ Timeout reactivateColour; int main() { - printf("Program has started\n\r"); + //printf("Program has started\n\r"); - ColourSensor ColourSensor(PTC16, PTC13, PTC12); + ColourSensor ColourSensor(PTC16, PTC13, PTE20); // Set call rate of colour detection function - detectColour.attach(callback(&ColourSensor, &ColourSensor::readIf), 1.0); + detectColour.attach(callback(&ColourSensor, &ColourSensor::readIf), 0.5); - // Test LED - //testLED2.period(1.0); - //testLED2.write(0.5); - - int firstLoop = 1; +// int firstLoop = 1; while (1) { // main program loop + /* if (firstLoop) { printf("Main loop has started\n\r"); firstLoop--; } + */ if (ColourSensor.toggleConst && ColourSensor.toggleA) { // Call readColSenWhich after x seconds - printf("Toggle A\n\r"); + //printf("Toggle A\n\r"); - readColour.attach(callback(&ColourSensor, &ColourSensor::readWhich), 0.4); + readColour.attach(callback(&ColourSensor, &ColourSensor::readWhich), 0.2); ColourSensor.toggleA = 0; } if (ColourSensor.toggleConst && ColourSensor.toggleB) { // Process colour sensor data - printf("Toggle B\n\r"); + //printf("Toggle B\n\r"); ColourSensor.process();