I am using VexCode V5 with the blocks and am receiving python error. After moving some stuff around and getting errors on lines that do not exist, I found the line that may be causing the issue, It is
def vexcode_driver_function():
Could this be the issue and what would be the fix for it, else, please let me know what other information I need to provide.
Thanks in advance.
Jouza
October 26, 2023, 1:36pm
2
Can we see your program?
What I think you’re referring to an error in another python file (not one created by you). Normally these errors occur because you might of incorrectly called it or passed in parameters incorrectly.
Could we also get the specific error you are getting.
I would provide the error and the code.
Go to the file menu, then “about” and then switch to C++ rather than Python fornthe blocks version.
Then try again and see what happens.
I don’t have the robot with me at the moment, however I can attach the .v5code file here - WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free
Have you tried turning it off and on
1 Like
I tried this and now get another error when compiling
unix build for platform vexv5
CXX src/main.cpp
src/main.cpp:148:37: error: redefinition of ‘rand’ as different kind of symbol
float Colision_position, Auto_time, rand, pew_pew_mode;
^
/home/ubuntu/cloudcompiler/Tools/sdk/vexv5/20220726_10_00_00/gcc/include/stdlib.h:125:12: note: previous definition is here
int _EXFUN(rand,(_VOID));
^
src/main.cpp:249:41: warning: ‘&&’ within ‘||’ [-Wlogical-op-parentheses]
} else if ((Colision_position > 1.0 && Colision_position > 1.5 || Colision_position > 1.5 && Colision_position > 2.25) || 2.25 < Colision_position) {
src/main.cpp:249:41: note: place parentheses around the '&&' expression to silence this warning
} else if ((Colision_position > 1.0 && Colision_position > 1.5 || Colision_position > 1.5 && Colision_position > 2.25) || 2.25 < Colision_position) {
^
( )
src/main.cpp:249:95: warning: '&&' within '||' [-Wlogical-op-parentheses]
} else if ((Colision_position > 1.0 && Colision_position > 1.5 || Colision_position > 1.5 && Colision_position > 2.25) || 2.25 < Colision_position) {
~~ ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.cpp:249:95: note: place parentheses around the '&&' expression to silence this warning
} else if ((Colision_position > 1.0 && Colision_position > 1.5 || Colision_position > 1.5 && Colision_position > 2.25) || 2.25 < Colision_position) {
^
( )
2 warnings and 1 error generated.
make: *** [vex/mkrules.mk:13: build/src/main.o] Error 1
make process closed with exit code : 2
Well, yes, you have a variable called “rand” but rand is a C standard library function.
so rename or remove that varable.
@jpalnick guess that name needs a filter.
and the warning, well that a code generation issue, not much you can do about that.
} else if ((Colision_position > 1.0 && Colision_position > 1.5 || Colision_position > 1.5 && Colision_position > 2.25) || 2.25 < Colision_position) {
it needs more parenthesis to keep the compiler happy.
2 Likes
This works. Thank you so much!
system
Closed
October 26, 2024, 4:54am
11
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.