![AWC GP3 Скачать руководство пользователя страница 23](http://html.mh-extra.com/html/awc/gp3/gp3_manual_3035292023.webp)
Quick Reference
Methods/Functions
Name
Parameters
Return
Description and Notes
high
pin
none
Set output pin to high
Automatically sets pin to output
low
pin
none
Set output pin to low
Automatically sets pin to output
toggle
pin
none
Reverse state of output
Automatically sets pin to output
inp
pin
Byte (ASCII 0 or 1)
Read input pin
Automatically sets pin to input
a2d
channel
word
Read analog channel
Returns 0 to 1023
a2dconf
justify, clk2x, reference
None
Set 1 to left justify result
Set reference = 0 for supply rails, 1 for analog 3 used as +
reference, or 4 for analog 2 as – reference and analog 3 as +
reference (note: clk2 parameter not used)
pwm
channel, duty_cycle,
duration/freq
none
Output pulse width modulation
If channel = -1, use hardware PWM with specified
frequency; otherwise use software PWM for specified
duration
Automatically makes pin an output
count
pin, duration
word
Counts pulses on specified pin for duration (in mS or 2mS
for Pi)
Automatically makes pin an input
rctime
pin, state
word
Measures time pin stays in state (2uS resolution; 4uS for Pi)
Automatically makes pin an input
pulsein
pin, state
word
Measures pulse (2uS resolution; 4uS for Pi)
Automatically makes pin an input
pulseout
pin, duration
none
Creates pulse on output pin for specified duration (2uS
resolution; 4uS for Pi)
Automatically makes pin an output
freq
pin, frequency, duration
none
Make pin an output and synthesize sine wave
Frequency in Hz (2 Hz for Pi), duration in milliseconds (2
mS units for Pi)
setcounter
prescale, mode
none
Set prescaler (1, 2, 4 or 8) and timer/counter mode
resetall
none
none
Reset GP3
repeat
count
none
Repeat next command
readbyte
none
byte
Read bytes from repeated command
readword
none
word
Read word from repeated command
Notes:
Pin numbers are from 0 to 7
A/D channels are from 0-4
-20-