RaceCapturePro Lua Scripting: Difference between revisions

No edit summary
Line 4: Line 4:


===getGpio===
===getGpio===
Retrieves the state of the GPIO ports
state getGpio(port)
*params: port - integer 0 - 2
*returns: 1 = port is high, 0 = port is low
When the port is configured for input mode, a voltage high input (> 2 volts) will read as 1; a voltage low will read as 0. A disconnected port will read as high due to the internal pullup resistor.
When the port is configured as output, the port reads 1 when the port is activated (output transistor is connected to ground) and 0 when the port is deactivated (pullup resistor is active)
===setGpio===
===setGpio===
Sets the state of the GPIO port when the port is configured for output mode.
setGpio(port, state)
*params: port - integer 0 - 2, state - 1 = output active; 0 = output inactive
*returns: none
When the state specified is 1, the output is active (transistor is conneced to ground). When state is 0, transistor is disconnected, and pullup resistor is active.
When configured for input mode this function has no effect.
===getButton===
===getButton===
Gets the state of the front panel pushbutton.
state getButton()
*params: none
*returns: 1 = pushbutton is depressed; 0 = pushbutton is not depressed


===isSDCardPresent===
===isSDCardPresent===
Indicates if an SD card is present in the socket
present isSDCardPresent()
*params: none
*returns: 1 = SD card is present in socket; 0 = SD card not present
===isSDCardWritable===
===isSDCardWritable===
Indicates if the SD card is writable (lock switch on SD card is active)
*params: none
*returns: 1 = SD card is writable; 0 = SD card is not writable


===setPWMDutyCycle===
===setPWMDutyCycle===

Revision as of 15:05, 2 April 2013

This page is under construction. Check back soon!

Scripting functions for RaceCapture/Pro

getGpio

Retrieves the state of the GPIO ports

state getGpio(port)

  • params: port - integer 0 - 2
  • returns: 1 = port is high, 0 = port is low

When the port is configured for input mode, a voltage high input (> 2 volts) will read as 1; a voltage low will read as 0. A disconnected port will read as high due to the internal pullup resistor.

When the port is configured as output, the port reads 1 when the port is activated (output transistor is connected to ground) and 0 when the port is deactivated (pullup resistor is active)

setGpio

Sets the state of the GPIO port when the port is configured for output mode.

setGpio(port, state)

  • params: port - integer 0 - 2, state - 1 = output active; 0 = output inactive
  • returns: none

When the state specified is 1, the output is active (transistor is conneced to ground). When state is 0, transistor is disconnected, and pullup resistor is active.

When configured for input mode this function has no effect.

getButton

Gets the state of the front panel pushbutton.

state getButton()

  • params: none
  • returns: 1 = pushbutton is depressed; 0 = pushbutton is not depressed

isSDCardPresent

Indicates if an SD card is present in the socket

present isSDCardPresent()

  • params: none
  • returns: 1 = SD card is present in socket; 0 = SD card not present

isSDCardWritable

Indicates if the SD card is writable (lock switch on SD card is active)

  • params: none
  • returns: 1 = SD card is writable; 0 = SD card is not writable

setPWMDutyCycle

setPWMDutyCycleRaw

setPwmPeriod

setPwmPeriodRaw

setAnalogOut

getTimerRpm

getTimerPeriodMs

getTimerPeriodUsec

getTimerFrequency

getTimerRaw

resetTimerCount

getTimerCount

getAnalog

getAnalogRaw

readSerial

writeSerial

getGpsLatitude

getGpsLongitude

getGpsSpeed

getGpsQuality

getGpsTime

getLapCount

getLapTime

getGpsSec

getAtStartFinish

getTimeDiff

getTimeSince

getAccel

getAccelRaw

startLogging

stopLogging

setLed

flashLoggerConfig

setAnalogSampleRate

getAnalogSampleRate

setAnalogScaling

getAnalogScaling

setPwmClockFrequency

getPwmClockFrequency

setPwmSampleRate

getPwmSampleRate

setPwmOutputConfig

getPwmOutputConfig

setPwmLoggingConfig

getPwmLoggingConfig

setPwmStartupDutyCycle

getPwmStartupDutyCycle

setPwmStartupPeriod

getPwmStartupPeriod

setPwmVoltageScaling

getPwmVoltageScaling

setGpsInstalled

getGpsInstalled

setGpsStartFinish

getGpsStartFinish

setGpsPositionSampleRate

getGpsPositionSampleRate

setGpsSpeedSampleRate

getGpsSpeedSampleRate

setGpsTimeSampleRate

getGpsTimeSampleRate

setLapCountSampleRate

getLapCountSampleRate

setLapTimeSampleRate

getLapTimeSampleRate

setGpioSampleRate

getGpioSampleRate

setGpioConfig

getGpioConfig

setTimerSampleRate

getTimerSampleRate

setTimerConfig

getTimerConfig

setTimerPulsePerRevolution

getTimerPulsePerRevolution

setTimerDivider

getTimerDivider

calculateTimerScaling

getTimerScaling

setAccelInstalled

getAccelInstalled

setAccelSampleRate

getAccelSampleRate

setAccelConfig

getAccelConfig

setAccelChannel

getAccelChannel

setAccelZeroValue

getAccelZeroValue

calibrateAccelZero