i tryed to run the Phoenix code on a Arduino Mega 2560, because it have much more memory.
For that i first have testet the PS2 Controller with the Testprogram from github and it was successful.
I thought the next step is the communication between SSC and the Arduino.
Hex_cfg.h
...
...
#if defined(UBRR1H)
#define SSCSerial Serial1 <--That is the serial 1 interface of the Arduino board: Pins (18,19)
#else
...
...
#define cSSC_OUT 0//18//8 //Output pin for Botboard - Input of SSC32 (Yellow)
#define cSSC_IN 0//19//9 //Input pin for Botboard - Output of SSC32 (Blue)
It take some trys until i realized that both SSC pins (IN, OUT) have to be “0”.
The TX and RX wires from the SSC have to be connected to TX1 and RX1 (18,19) on the Arduino board.
Don’t try the TX0 and RX0. That will not work because it is in conflict with the USB connection with the computer.
Ok, if i start the robot it is a little bit crazy.
I have made a Video, you should see that
As long as it goes in any direction, its ok.
Whenever it is in idle, it begins to shrug with its tail and head.
And i have tested the connection with the software serial interface. That works.
It seems that the Code doesn’t work with a hardware serial interface.
And yes, its a problem of the code. If i write a simple program like this…
…it works without problems.
I would nevertheless like to use the hardware serial interface.
I found out, if i comment out the code for the mandibles and tail, other parts of the robot twitch instead.
But, if i print the commands for the ssc to the debug monitor, they are ok.
I dont know if this error happens on the ssc board, or are the wrong commands produced by the phoenix code.
Did you solve the error? I am guessing it should be by phoenix code. You are more experienced so I really want to know where have you reached.
Please share more details with us.
I have long time did not do anything more to the code.
No i didn’t solve the error. But i think it’s a problem with the timing.
The code calculates an interval between every cycle.
They implement this pause with the delay function. Not a good idea.
This could be the problem. But finally it does not matter.
I dug not deeper at this point because my focus was elsewhere in the project.
Only for other functions it is not so good that the controller sleeps some time.
Because this is primarily reaction time for executing commands.