Changing SDA Pin mode in software

Hi. I’m using a TIC 36v4 to control a stepper motor that drives my dome around. I use the limit switch reverse function on SDA to allow the dome to find Home. The snag arrives if I want to travel beyond the switch position as of course a dome can continuously rotate. So I decided I could maybe use the set_sda_pin_mode function to turn SDA off as a limit switch after the homing had been done and turn it back on as a limit switch when I need it for homing. I only use the home function at most once per evening viewing, and often not even then !
However try as I might I cannot get this switching to actually happen. I’m verifying the pin status by using the Pololu Tic control center having run code to change the pin mode. The pin mode never changes. I’ve also tried using

bool v = m_tic.set_setting_byte(61, 9);
to set it as a limit switch and then

bool v = m_tic.set_setting_byte(61, 2);
to disable the limit switch

and again nothing changes when I check in the control center. I’m using C# in Microsoft Visual Studio

Any suggestions
Thanks
Tim

Hello, Tim.

It looks like you’re trying to use an offset of 61 (which is 0X3D in hex); please note that this is the offset value for the TX pin configuration. For the SDA pin configuration, you should be using an offset of 60 (0x3C in hex).

Are you using a C# library for the Tic, and if so, could you link to it? Alternatively, could you post the code for your set_setting_byte() function?

Brandon

Hi Brandon

Thank you for the response

My mistake, in the actual code I did use the correct address. This was a test to see if I could change any of the pins modes, which I couldn’t

Yes I am using the C# library for the TIC. I tried using the method to directly change the SDA pin but that didn’t work either and actually returned “false”.

Regards

Tim

Can you post a link to the C# library you’re using?

Brandon