Line follow code not working when uploaded


#1

The code works “when clicked” but nothing happens when uploaded. No errors in either upload.

I tested process with uploaded test motors code
Here are all 3 programs


#2

Hi rojoamigo,

Could you test again if the online program works properlly? If yes, how about try set the speed value larger (like 100) in case the speed vale set too low so that the power from battery only can’t drive the motors in offline mode.


#3

Hi Tec:

I ran the test again with the same results:

  • line follow (online/click) works
  • line follow (upload) no movement
  • motor test (upload) works (the 3rd example I enclosed)

I also doubled the motor speed for " line follow (upload)" and still no movement.

note: the motor blocks are the same in all three examples.

The “motor test” upload program was to verify that there was enough battery power to run the motors and that I was using the correct procedure to upload.


#4

I tried even a more simple program (included). I place the robot on a track with a 30cm straight line and ensure IR line finder is in middle of path (no lights on).
Result after upload is robot drives forward for the 1 sec and then stops. In other words, it ignores everything in the repeat loop.

If I replace the repeat loop with a forever loop, it works. However, this means I have to manually turn on/off the robot when I do small tests.


#5

I guess it does does ignore the content of the loop. But in Arduino mode the 3000 repetitions are done very fast. Replace by repeat forever.


#6

Andreas, that is what I did.
However that requires more physical interaction with the robot. One of my projects is design specs for building a race track, modelling F1 tracks. I have found that the ultimate tank has limitations on angle of turns. I have been testing different S curves to see what it can handle. It was easier to do when I did “just X repeats”.

note: my “to do” project list is constantly increasing. Looking at getting a starter kit so that I can do parallel projects, though inter robot communications (non mbot to mbot) seems to be a non-starter (separate topic)


#7

Hi rojoamigo,

As Andreas explained, repeat 3000 is too fast in arduino mode.
You may try use the timer to make the program stop automatically. Here is an example program to you for reference:


#8