Specifications
getInfo(whichInfo) – Get specified system info........................................................................... 51
getLq() – Get the most recent Link Quality .................................................................................. 55
getMs() – Get system millisecond tick.......................................................................................... 55
getNetId() – Get the node’s Network ID ...................................................................................... 56
getStat() – Get Node Traffic Status............................................................................................... 56
imageName() – Return name of currently loaded SNAPpy image............................................... 57
i2cInit(enablePullups) – Setup for I
2
C ......................................................................................... 57
i2cRead(byteStr, numToRead, retries, ignoreFirstAck) – I2C Read .......................................... 58
i2cWrite(byteStr, retries, ignoreFirstAck) – I
2
C Write ............................................................... 58
initUart(uart, bps) – Initialize a UART (short form) ................................................................... 58
initUart(uart, bps, dataBits, parity, stopBits) – Initialize a UART.............................................. 59
initVm() – Initialize (restart) the SNAPpy Virtual Machine......................................................... 59
int(obj) – Convert an object to numeric form (if possible) ........................................................... 59
lcdPlot() – LCD Support (Deprecated) ......................................................................................... 60
len(sequence) – Return the length of a sequence .......................................................................... 60
loadNvParam(id) – Read a Configuration Parameter from NV................................................... 61
localAddr() – Get the node’s SNAP address ................................................................................ 61
mcastRpc(group, ttl, function, args…) – Multicast RPC ............................................................ 61
mcastSerial(destGroups, ttl) – Setup TRANSPARENT MODE ................................................. 62
monitorPin(pin, isMonitored) – Enable/disable monitoring of a pin .......................................... 62
ord(str) – Return the integer ASCII ordinal value of a character.................................................. 63
peek(address) or peek(addressHi, addressLow, word) – Read a memory location..................... 63
peekRadio(address) – Read an internal register of the radio........................................................ 64
poke(address, value) or poke(addressHi, addressLow, word, data) or poke(addressHi,
addressLow, word, dataHi, dataLow) – Write to a memory location........................................... 64
pokeRadio(address, value) – Write to an internal radio register.................................................. 65
print – Generate output from your script ...................................................................................... 65
pulsePin(pin, msWidth, isPositive) – Generate a timed pulse...................................................... 66
random() – Generate a random number........................................................................................ 67
readAdc(channel) – Read an Analog Input pin (or reference)..................................................... 67
readPin(pin) – Read the logic level of a pin................................................................................. 67
reboot() – Schedule a reboot ......................................................................................................... 67
resetVm() – Reset (shut down) the SNAPpy Virtual Machine..................................................... 67
rpc(address, function, args…) – Remote Procedure Call (RPC) ................................................. 68
rpcSourceAddr() – Who made this Remote Procedure Call?...................................................... 68
rx(isEnabled) – Turn radio receiver on/off ................................................................................... 69
saveNvParam(id, obj) – Save data into NV memory ................................................................... 69
scanEnergy() – Get energy readings from all channels................................................................ 70
setChannel(channel) – Specify which channel the node is on..................................................... 71
setNetId(networkId) – Specify which Network ID the node is on ............................................... 71
setPinDir(pin, isOutput) – Set direction (input or output) for a pin............................................. 71
setPinPullup(pin, isEnabled) – Control internal pull-up resistor................................................. 72
setPinSlew(pin, isRateControl) – Enable/disable slew rate control............................................. 72
setRadioRate(rate) – Set raw radio data rate................................................................................ 72
setRate(rate) – Set monitorPin() sample rate................................................................................ 73
setSegments(segments) – Update seven-segment display............................................................ 73
SNAP Reference Manual Document Number 600-0007K Page 5 of 202