Stephane_bzh
Member
Hi Juergen,
No i have no code, but it is not to difficult to add :
Here are two examples (not tested because just written here, may be some compilation issue...)
in motor.cpp
In void Motor::test() {
Just add at the beginning the following code, it will start the mowing motor at full speed
while (1) {
speedPWM(0, 0, 255);
sense();
watchdogReset();
robotDriver.run();
}
You my try the following code if you want the speed to increase by 10 every 2 seconds until speed = 240 (it will be reset to 0).
byte spd = 0;
unsigned long wait_t = millis();
while (1) {
speedPWM(0, 0, spd);
if ( (millis() - wait_t ) > 2000) {
spd += 10 ;
Wait_t = millis() ;
if (spd == 250) {
spd = 0 ;
}
}
sense();
watchdogReset();
robotDriver.run();
}
If you need some more help don't hesitate to ask.
For information my 8015a is working fine!
Stephane.
No i have no code, but it is not to difficult to add :
Here are two examples (not tested because just written here, may be some compilation issue...)
in motor.cpp
In void Motor::test() {
Just add at the beginning the following code, it will start the mowing motor at full speed
while (1) {
speedPWM(0, 0, 255);
sense();
watchdogReset();
robotDriver.run();
}
You my try the following code if you want the speed to increase by 10 every 2 seconds until speed = 240 (it will be reset to 0).
byte spd = 0;
unsigned long wait_t = millis();
while (1) {
speedPWM(0, 0, spd);
if ( (millis() - wait_t ) > 2000) {
spd += 10 ;
Wait_t = millis() ;
if (spd == 250) {
spd = 0 ;
}
}
sense();
watchdogReset();
robotDriver.run();
}
If you need some more help don't hesitate to ask.
For information my 8015a is working fine!
Stephane.
Zuletzt bearbeitet: