By Youssef Al-Shanti (Mission, Systems, and Tests)
The picture above is the block diagram for our software. you can see from the block diagram the big picture of how our software works. the blocks in red are the functions responsible for sending and receiving data to and from the Rosco.
Next are the blocks in blue which are the functions responsible for executing commands or receiving data and displaying it. The blocks in purple show the part of microprocessor that is used for the specific command. The green blocks show which pins those commands are going to be sent/received through. The rest of the blocks are the external hardware that the commands are sent/received to/from.
In the picture above is the code for the for the move function. If the microprocessor receives the command move (0X01) it calls the function move_L293D and it passes it the speed and the direction for each motor. below is the move_L293D function and how it works.
So, the move_L293D function initiates the motors and then sets the speed for each motor and the direction.
If the microprocessor receives the command LIFTING (0x41) it calls the function move_servos and it passes it the new angle that servos are supposed to be in. below is the move_servos function.
The move_servos function sets the original angle for the servos to zero degrees. Then when a new value passed in it checks if the servos are already in that position. If not it decreases or increases the angle of the servo by a factor of one until it reaches its new angle.
The software can be found here arxrobot_firmware.