Combined code (SD_logging + Servo) not working ActivityBot360 (C)
Hello,
I have a problem with the ActivityBot360 when trying to map a route by navigating against a wall on the right-hand side with an IR sensor and writing the stepped angle to an SD card.
The robot can run both the servo required functions and the SD logging functions separately, but when combining the functions into one code it does not work at all and stalls when loaded into the robot.
he problem I am having seems to be that the servo360_connect is somehow blocking the sd_mount function (not 100% sure).
I added two pdfs:
-logg_speed_2.pdf is the code for running them both simultaneously.
-logg_speed.pdf is the same but here saving 48 movements into an array and then trying to log that array to SD card when done (more extra steps here).
Is there any workaround for this problem?
Comments
I took a look at your code and it looks ok.
I think your running into a stack issue here. The compiled size is over 30k and there is no check for stack overflow conditions in the code.
There are several variables being created in the functions and floating point adds a lot of program code.
Mike
Thanks for the answer Mike.
The temporary work around we found was adding another board as a listener and connecting them together via the serial port and sending the data via that link. Far from optimal but it works.