top of page

# A/D Commands

Purpose Use this to set a gradient and offset for the JackBord’s A/D converter. This will be used on all analog readings.

grad A floating point gradient value. offset A floating point offset value.

Notes Don’t use this unless you know what you are doing.

##### gav - Get analog voltage reading. Returns a floating point value.

Purpose Get a voltage reading from the specified port analog pin. If the min and max values are provided the output will be scled between them. If no min & max values are provided the output will be the reading from the A/D in volts.

Syntax gav #~ min max Arguments #~ The pin from which to get the reading min An integer minimum value. -1000 to 1000 max An integer maximum value. -1000 to 1000

Examples 1. Just get a voltage reading from port pin A1: gav a1 The reading will be between 0V and 3.1V. 2. Scale the input voltage between 0 and 12V: gav a1 0 12.0 This means that if the input voltage is 3.1V the voltage from the JackBord will be 12V. You can use this to turn the JackBord's analog input into a voltage probe that can measure various voltage ranges. For example if you put two 10K resistors into a potential divider and feed the center into port pin A1, run this command: gav a1 0 6.2 This will have the effect of scaling the input between 0 and 6.2V and the value given by the gav command will be correct. Notes: To stop using the pin as an analog input run the gav command with the pin name and 0. eg to stop using a2 as an analog input run gav a2 0.

##### admax - Set the A/D Converter Max Voltage Scale Value

Purpose

If this is not 0 it is used to set the Max voltage that the A/D converter 4096 reading represents.

Syntax

Arguments

value

A floating point voltage value, 0 to 100

Notes

Don’t use this unless you know what you are doing.

Purpose

Sets the max digital reading we will get at full scale. This is usually 10 bits = 1024 12 bits = 4096

Syntax

Arguments

value

A positive integer value, between 1000 and 4096.

Notes

Don’t use this unless you know what you are doing.

bottom of page