1. Home
  2. Docs
  3. MANUALS AND DATASHEETS
  4. Polaris Manual
  5. Main Connector
  6. Using Digital Outputs

Using Digital Outputs

There is an 8 channel relay output driver on the internal SPI interface, with the first 6 channels that share the same pin with digital and analog inputs of the Main connector, and the last 2 channels that can enable 4-20 mA input interface on the first 2 analog inputs. Output channels can also be configured to be controlled by digital pins, with support for PWM mode (IN1 for odd channels, IN2 for even channels).

Here below the simplified schematics:

Here is an example Arduino sketch that configures the driver and toggles AIO1 and AIO2 outputs using GPIO pins:

#include <SPI.h> void setup()  void loop()  

The same example with Zerynth:

from fortebit.polaris import polaris from fortebit.polaris import ioexpander polaris.init() iox = ioexpander.IOExpander() pinMode(polaris.main.PIN_IOEXP_IN1, OUTPUT) pinMode(polaris.main.PIN_IOEXP_IN2, OUTPUT) iox.setAllChannels(iox.CH_STANDBY) iox.setAllChannels([iox.CH_INPUT, iox.CH_INPUT]) while True: digitalWrite(polaris.main.PIN_IOEXP_IN1, HIGH) sleep(500) digitalWrite(polaris.main.PIN_IOEXP_IN2, HIGH) sleep(500) digitalWrite(polaris.main.PIN_IOEXP_IN1, LOW) sleep(500) digitalWrite(polaris.main.PIN_IOEXP_IN2, LOW) sleep(500) 

How can we help?