This program is for an autonomous robot for the competition at the Hochschule Luzern. http://cruisingcrepe.wordpress.com/ We are one of the 32 teams. http://cruisingcrepe.wordpress.com/ The postition control is based on this Documentation: Control of Wheeled Mobile Robots: An Experimental Overview from Alessandro De Luca, Giuseppe Oriolo, Marilena Vendittelli. For more information see here: http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf
Fork of autonomous Robot Android by
Diff: State/State.cpp
- Revision:
- 27:a13ede88e75f
- Parent:
- 24:08241be546ba
--- a/State/State.cpp Mon May 20 09:41:47 2013 +0000 +++ b/State/State.cpp Mon May 20 11:51:33 2013 +0000 @@ -15,7 +15,11 @@ PinName batteryPin, float period) : Task(period) , - battery(batteryPin) + battery(batteryPin), + led1(LED1), + led2(LED2), + led3(LED3), + led4(LED4) { /* get peripherals */ this->s = s; @@ -24,6 +28,7 @@ this->motorControllerRight = motorControllerRight; this->battery =battery; this->period = period; + } State::~State() {} @@ -146,6 +151,27 @@ return (sin(f + float(idx)* 1.0) + 1.0) / 2.0; // transform value from -1.0 .. 1.0 to 0.0 .. 1.0 } +void State::ledArray(float wait) +{ + for (float f = 0.1f; f < 6.3f; f += 0.1f) { + led1 = dim( 0, f ); + led2 = dim( 1, f ); + led3 = dim( 2, f ); + led4 = dim( 3, f ); + + wait_ms(wait); + } + wait_ms(wait/0.2); + for (float f = 0.1f; f < 6.3f; f += 0.1f) { + led1 = dim( 3, f ); + led2 = dim( 2, f ); + led3 = dim( 1, f ); + led4 = dim( 0, f ); + wait_ms(wait); + } + wait_ms(wait/0.2); +} + void State::run() { s->millis = timer.read_ms();