SMC from usb question

Hello,

I’m thinking about using a smc 18v25 in order to control motor from a PC, but want to use also the 2 analogs as switches for event detection entries.

I’ve checked the class library for motor control, but I’m not sure to understand how you can deal with analog entries ? I was expecting that analog entries would fire events, but I don’t find this.

As a simple example, how would you write a program supposed to do

  • start the motor
  • do an action when an analog entry is switched on (example of analog as limit swith for example)

Benny

Hello, Benny.

The class libraries in the Pololu USB SDK do not fire any events, but there is a method you can call to read the voltage on the analog inputs and other information from the controller. Please see the source code of SmcCmd for some example code that reads the analog inputs and example code that controls the motor.

–David

Ok I understand, just wanted to be sure.

So you have to write your own control loop in order to monitor the inputs status.

Thanks and best regards