We do not currently offer a conversion utility for the pattern files created by the FlowBotics Studio sequencer and coding for Arduino (or other platform), but it is certainly possible to play pre-determined sequences from an Arduino-compatible board, such as what the Lynxmotion Hexapod kits do.
You can find here an example of a BotBoarduino code that performs a pre-defined sequence (connected to the servomotors directly, using the Arduino Servo library). You could easily replace the call to the Servo library ( .write() and .writeMicroseconds() ) by a Serial.println() instead, to send the position commands to the SSC-32U through the boards serial port (or using SoftwareSerial).
The output to the pattern file is done using the Ruby core command Marshal on the patterns object that was saved. Here is an example of what a typical output of a pattern object looks like:[code]#<Sequence:0xcfcc540
@frames=
#<Sequence::Frame:0xcfcc4dc
@t=0,
@duration=1.0,
@data={
:servos=>
1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500
],
:onOff=>
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
]
},
@pause=false
,
#<Sequence::Frame:0xcfcc39c
@t=1.0,
@duration=1.0,
@data={
:servos=>
500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0
],
:onOff=>
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
]
},
@pause=false
,
#<Sequence::Frame:0xcfcbcd0 @t=2.0,
@duration=1.0,
@data={
:servos=>
2500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0, 1500.0
],
:onOff=>
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
]
},
@pause=false
],
@name=“SequencerExample”
]
[/code]
Please find attached a copy of the original pattern file.
Sincerely,
SequencerExample.pat.txt (667 Bytes)
SequencerExample.txt (1.49 KB)