Not sure what your real question is here. (before 7:00am here)
From your question I am assuming that you are wanting to use the general purpose sequencer on the SSC-32 (lynxmotion.com/images/html/build137.htm) to run a different sequence depending on your sensor. The first step would be to use a program like SEQ to generate the sequences and to download them to your SSC-32. Note: the SSC-32 serial port would have to be connected to your PC either directly or possibly through bluetooth. Instructions for this are in the SSC-32 manual or for bluetooth in the forum. Once you have these sequences working the way you want, you would then switch the input lines of the SSC-32 away from your PC to be your micro.
But if your question is simply how to connect your microprocessor to the SSC-32 then you need to connect 1 or 2 IO lines from your micro to the SSC-32 TTL serial input lines.
On the SSC-32 side there is information in the SSC-32 users manual lynxmotion.com/images/html/build136.htm for this and you can look at several of the different tutorials on the website that shows this. Now on your ATMega16/32 (I will assume 16 for the rest of this as for the most part the only difference is memory size…) side this can be a little more fun. Atmega16s only have one hardware serial port. My guess is that you will end up using this to support the bluetooth. So you will probably have to use your own software to do the serial communication to the SSC-32. Awhile ago I used to interface a serial LCD to my Atmega32 and I had bit bang code for 9600 baud that looked something like:
[code]{
if (fHi)
m_pout->High();
else
m_pout->Low();
// Now need to wait a right time for 9600 baud...
// try looping enough times to use up the timer.
// need to check compiler output for final devisor... 6
_Delay((((unsigned short)(F_CPU/9600))-150)/6); // try to convert to number of loops to wait. 35 approx cycles used elsewhere...
}
/* writes a character at the current location, updates
current location to next space (to right) */
void SerLCD::WriteCh(unsigned char ch) const
{
// Here is the workhorse.
int i;
// Need to first output the Start Bit
_WriteBit(true);
for (i=0;i<8;i++)
{
// Output each bit
_WriteBit((ch & 1)? false : true);
ch = ch >> 1;
}
// Now output Stop Bit
_WriteBit(false);
// try a slight wait after each character
// m_ptimer->WaitMs(1);
}[/code]
Note: this might rely on some other support functions but should give you an idea…
Now assuming you have written code for the Atmega to read in the Sharp IR sensor using one of the ADC channels, you could simply take the values returned from the sensor and output a command to the SSC-32 through the serial port as mentioned above. For example if you have saved away the walk forward sequence starting at location 5 and through your sensor code you decide that is what you wish to do, then you would output the ASCII text of something like: “PL 0 SQ 5”, where the is a carraige return. The syntax for this command are in the general sequencer document I mentioned above.
I hope this helps, and Good Luck
Kurt