TicI2C how to code for 12 tics?

hi,
i have to address in my Arduino sketch a number of Tics (>10).
they are connected through I2C.
with a Serial connection i could do:
TicSerial tic[] = {
TicSerial(ticSerial, 14),
TicSerial(ticSerial, 15),
TicSerial(ticSerial, 16),
TicSerial(ticSerial, 17),
TicSerial(ticSerial, 18),
etc

however, with TicI2C i cannot find the right coding.

can you please give me a ‘hand’ in this?

rolf meesters

i think i found the answer:
TicI2C tic[] = {14,15,16,17,18,19,20,21,22,23,24,25,26,27};

rolf

well, the compiler doesn’t complain, but somehow it’s not working.
when i send to tic[1] (alternative number 15) nothing happens.
changing in the array tic[1] to 14 (the general tic number) the stepper is moving.

with Serial input on the same Tic it listens to its alternative number.

what could be wrong?

rolf

Hello, rolf.

It sounds like you are trying to use the alternate device number for the I2C slave address; instead, you should change the device number for each Tic (not the alternate device number) and use that as the I2C address. The alternate device number is only used for TTL serial interface.

Brandon

BrandonM via Pololu Forum schreef op 27-01-2021 0:47:

blocked.gif | BrandonM Pololu Employee
January 26 |

  • | - |

Hello, rolf.

It sounds like you are trying to use the alternate device number for the I2C slave address; instead, you should change the device number for each Tic (not the alternate device number) and use that as the I2C address. The alternate device number is only used for TTL serial interface.

Brandon


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

thanks Brandon for the info.

it’s a kind of a bummer (of course not your fault).

rolf

BrandonM via Pololu Forum schreef op 27-01-2021 0:47:

blocked.gif | BrandonM Pololu Employee
January 26 |

  • | - |

Hello, rolf.

It sounds like you are trying to use the alternate device number for the I2C slave address; instead, you should change the device number for each Tic (not the alternate device number) and use that as the I2C address. The alternate device number is only used for TTL serial interface.

Brandon


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

does it also mean that a ‘general’ command for all Tics has to be repeated for every Tic seperately?

rolf

For a Tic to respond to an I2C command, it must specify its I2C slave address. So if you want all of the Tics to respond to an I2C command, you will need to repeat the command for each unique device number assigned to your Tics.

Brandon

BrandonM via Pololu Forum schreef op 27-01-2021 20:36:

blocked.gif | BrandonM Pololu Employee
January 27 |

  • | - |

For a Tic to respond to an I2C command, it must specify its I2C slave address. So if you want all of the Tics to respond to an I2C command, you will need to repeat the command for each unique device number assigned to your Tics.

Brandon


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

thanks again Brandon, and also to your colleagues, for the to the point support you give through this forum.

as a conclusion we decided to not use the I2C but the Serial connection for the Tics.

just for your information:

on the UNO WiFi rev2 hardware port Serial1 seems perfect for this job.

but this define taken from the Tic’s examples does not work well

#ifdef SERIAL_PORT_HARDWARE_OPEN
#define ticSerial SERIAL_PORT_HARDWARE_OPEN
#else

it took me some time to find out the Arduino was barking at the wrong tree (Tic)

because SERIAL_PORT_HARDWARE_OPEN is in some library already defined as Serial2 which is connected to the wifi module.

replacing the above mentioned lines with

#define ticSerial Serial1

did the tric.

rolf