Robot programming

Good, how are you? Could you please help me with my programming, last Saturday we updated the brain firmware and the same programming that we were using days before did not work, we even got an error in Python but the code is in blocks, could you help me solve the problem, or if someone had the same problem

We can’t help you until you give us more information to work off of. Please attach some pictures/screenshots of your blocks code so we can identify the problem and suggest solutions for it.

Without seeing the code, we can’t really help you. Aside from reading the exception message, I would check your code to see if there are any spots doing division with a variable in the denominator, and whether the value that variable could hold would ever be zero

1 Like

I would start by checking file “user.py” line 84 in when_started2 and seeing if maybe you divide by zero. Just a thought.

6 Likes

Here I pass the code in blocks that it makes

Looks like actual is initialized to zero

1 Like

Well this comment wasn’t helpful. But lets try to do similar to what they suggested. They mentioned its in blocks. However that doesn’t mean the error tells us nothing.

“when_started2” in the error is saying the second when started block in your program. So we can look at the second when started block and see the only value you divide by is “actvel”. From there we figure out what are the possible values for that variable. We see it was set to 0 initially and realize it will be 0 until you press any button.

2 Likes

see this post about VEXcode 3.0,

specifically note this.

  • Blocks projects now use Python when downloading projects

Blocks now use Python rather than C++ (there is a way to switch back, however…)

The error is pretty specific, you have a divide by zero somewhere which if you look at the program seems fairly obvious (meaning look at where you see any divides and think about what value that may have).

4 Likes

You’re right, my bad. I was thinking more along the lines of “look at line 84 of the Python code” (since IIRC the Python is easily accessible on blocks projects).