In getting my new quadruped robot re-assembled and the legs adjusted, I first use PowerPod to align the servos at the 1500 position and then assemble. I then go on to connect to the Basic Atom.
Not all my servos could be mounted at this point, and I make changes in the “neutral” positions. So I find myself needing to go back and forth between the Basic Atom and directly to the SSC-32.
I have an idea that if the Basic Atom code had a “pass-through” command, i.e., could be sent raw SSC-32 commands via the com from the PowerPod and Sequencer programs, then I could talk directly to the SSC-32, without having to re-cable.
A few things would be needed:
Two-way coms between the SSC-32 and the Basic Atom pro (currently there is only a TX line out of the Basic Atom into the SSC-32.) Maybe this isn’t necessary.
Code for the Basic Atom to copy variable-length commands sent from the PowerPod and forward them to the SSC-32.
The PowerPod and Sequencer programs both require the SSC-32 to respond to the VER (or something similar) command with an appropriate response before being “connected”. This mechanism would probably have to be duplicated in order for either program to be enticed into talking to the Basic Atom program.
Although it would be convenient to just “add-in” this code to a hexapod (or 'quad!) program, It would be simpler to implement the function as a separate program.
Upon first thinking, this should be a simple program in BASIC, however I am finding out that Atom Basic is practically devoid of all the rich string handling functions in (ANSI) BASIC. Probably the only commands really needed are the ones to determine string length, and do a simple match of strings. These can be written out in Basic.
I tried a few lines of code:
buff var Byte(20)
buff = "test"
serout S_OUT,i9600,[str buff\4,cr] ; worked to get the string out.
Loop
serin S_OUT,i9600, [str buff\4\cr] ; try just 4 characters
; Character by character xfer
;
; serin S_OUT,i9600, 200000,NoData, [echo]
; serout S_OUT,i9600,[echo]
;
; buff(i) = echo
; i = i + 1
;
; if echo = cr or i = 18 then
; i = 0
;
serout S_OUT,i9600,[str buff\4,cr] ; try just sending 4 characters
; endif
NoData
goto Loop
Wasn’t too successful! And the “str” modifier isn’t extensively documented in either of the MBasic or Atom Pro manuals I had available to check (I’m compiling code on the 'pro).
I commented out the char by char read, didn’t get anywhere with it either.
The serin “str” command didn’t seem to work, possibly crashing and causing a re-boot, which would be a symptom of writing too many characters into a buffer. One would think the \4 and the \cr modifiers would prevent that.
I’ll probably take this over to the Basic Micro forum to get more information on the command and it’s modifiers when I get some time.
I’m interested in hearing if anyone has successfully used these modifiers, or if there is any interest in a program like this to allow a simple pass through.
I’ve successfully implemented a parser in C for the SSC-32 VER and some other commands that went into Loki, so I have the algorithms needed. But would it be worth it for this application?
I’d like to hear any comments or this or any similar program (module?) that might exist. Surely someone has done this already!
Alan KM6VV