After you install the Zumo library you'll find a lot of helpful example code at File > Examples > Zumo32U4. I don't think anyone here is going to do much better than that. The way to approach programming is to start very simple and gradually work your way to more complex programs. Don't move on to the next program until you fully understand the current one. If you try to jump right into a complex battlebot program as a beginner then of course you're going to feel like you're bad at programming. But it's not that you're bad at it, it's just that you skipped over some of the fundamentals.
UKHeliBob:
So what did you try ?
What is the specification for the bot ?
As you can see I have a "decent" code but.... The Problem ist that every-time the robot tries to curve a obstacle it looses control over the line sensor and it leaves the battleground.
Is there any prioritization?
I don't know the specifications - it is a normal Zumo 32U4
You need to get rid of all the calls to the delay function.
You wouldn't walk down a busy street by taking a look around, starting to walk and closing your eyes for most of the time.
pert:
After you install the Zumo library you'll find a lot of helpful example code at File > Examples > Zumo32U4. I don't think anyone here is going to do much better than that. The way to approach programming is to start very simple and gradually work your way to more complex programs. Don't move on to the next program until you fully understand the current one. If you try to jump right into a complex battlebot program as a beginner then of course you're going to feel like you're bad at programming. But it's not that you're bad at it, it's just that you skipped over some of the fundamentals.
The problem is I have a deadline and not enough time to fully engage with the topic
Thanks
Victrizz:
The problem is I have a deadline and not enough time to fully engage with the topic
Sometimes the best way to go fast is to go slow.
You should regularly use the Arduino IDE's Tools > Auto Format feature on your code. With the screwy indentation you have now your code is very difficult to understand. If you're using the Arduino Web Editor you will not have access to this very useful feature. I recommend you to use the real IDE instead, which you can download for free from here: http://www.arduino.cc/en/Main/Software
There is no prioritisation as such. The code executes line by line but if it is in a loop during which the line sensor is nor being read then obviously it cannot react to it.
For the schoolprojekt only the result counts not really how good I have understand it
With that attitude you won't get very far. If I had given you the project to do I would expect you to be able to explain how and why the bot and the code worked when you presented the result.