|
Veethree D7 SDK
|
Please also have a look at the details page for Hardware interfaces to get a better understanding of what functionality is available on the D7.
The example code in cli-digital.cpp demonstrates using the digital inputs and digital outputs by mirroring the input on channel DIN0 to the output on channel DOUT0.
This example uses pins "DIN0" and "DOUT0", which correspond to pins 35 and 25 on the AMPSEAL 35-pin connector on the D7, to mirror the digital input (on/off) from DIN0 to the the digital output on DOUT0.
You will need a small consumer like a 12V LED strip or an LED + pulldown resistor between pins 25 and 30 on the AMPSEAL 35-pin conenctor. You must have a resistor between the DOUT0 and PWRIN- pins.
To turn the input "on", apply 12V to pin 35 on the AMPSEAL 35 connector; to turn the input "off", you can leave it floating.
The example code in cli-pwm.cpp demonstrates:
This example uses PWM input pins and output pins on the AMPSEAL 35-pin connector:
PWM Inputs:
PWM Outputs:
To test PWM functionality, you can:
The example code in cli-i420.cpp demonstrates reading 1 value from pin sns0 of the 4-20mA interface.
Input sns0 maps to Ampseal 35-way connector pins 12 (420MA_0+) and 23 (420MA_0-). Those pins must be connected to a current sender/source/generator/sensor.
Connect the negative pin (420MA_0-) to the current loop in such a way that the current flows into the pin. The 420MA_0- pin must be the final device on the current loop.
For loop-powered current senders, the positive pin (420MA_0+) may be used to power the loop. This pin produces a voltage output equal to D7 supply voltage, limited to 33mA.
For externally powered current senders, leave 420MA_0+ disconnected.
The example code in cli-analog.cpp demonstrates:
This example uses pin "VRSNS_0", which corresponds to pin 6 on the AMPSEAL 35-pin connector on the D7, to measure an external resistance.
You will need to connect a resistance of known value between pin 6 of the AMPSEAL 35-pin connector and pin 4 (AGND) on the AMPSEAL 23-way Connector before running the example on the target device.
The example code in cli-analog-events.cpp demonstrates:
This example is based on analog reading, but it is also possible with PWM, 4-20 mA and digital inputs.
This example uses pin "VRSNS_0", which corresponds to pin 6 on the AMPSEAL 35-pin connector on the D7, to measure an external resistance.
You will need to connect a resistance of known value between pin 6 and pin 14 (RREF) on the AMPSEAL 35-pin connector before running the example on the target device.