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: mbed
Fork of Roboshark_V9 by
Diff: IRSensor.cpp
- Revision:
- 15:8e8b23d4abb4
- Parent:
- 14:feafcee53fed
--- a/IRSensor.cpp Mon May 14 22:11:47 2018 +0000 +++ b/IRSensor.cpp Tue May 15 21:50:26 2018 +0000 @@ -37,8 +37,8 @@ -IRSensor::IRSensor(AnalogIn& IrRight, AnalogIn& IrLeft, AnalogIn& IrFront, float dis2R, float dis2L, float dis2F, AnalogIn& LineSensor) : -IrRight(IrRight), IrLeft(IrLeft), IrFront(IrFront), dis2R(dis2R), dis2L(dis2L), dis2F(dis2F), LineSensor(LineSensor){ +IRSensor::IRSensor(AnalogIn& IrRight, AnalogIn& IrLeft, AnalogIn& IrFront, float dis2R, float dis2L, float dis2F, AnalogIn& LineSensor, DigitalIn& button) : +IrRight(IrRight), IrLeft(IrLeft), IrFront(IrFront), dis2R(dis2R), dis2L(dis2L), dis2F(dis2F), LineSensor(LineSensor), button(button){ ticker.attach(callback(this, &IRSensor::codeB), Period); this-> ende = ende; ende = 0; @@ -124,7 +124,15 @@ if (line == 1) { ende = 1; } + if (button == 0){ + ende = 0; + finish = 0; + finishLast = 0; +} finishLast = finish; + + /// printf("Ende = %d\n",ende); + // printf("BL = %d\n",button); return; }