RaceCapturePro Lua Scripting
This page is under construction. Check back soon!
Scripting functions for RaceCapture/Pro
getGpio( port )
Retrieves the state of the GPIO ports
- params
- port: integer 0 - 2
- returns:
- state: 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 ( port, state )
Sets the state of the GPIO port when the port is configured for output mode.
- 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 connected 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.
- params
- none
- returns
- state: 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
- present: 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
- writable: 1 = SD card is writable; 0 = SD card is not writable
setPwmDutyCycle( port, dutyCyclePct )
- params
- port: PWM / Analog output port 0 - 3
- returns
- none
Sets the duty cycle of the specified PWM / Analog output port to the specified duty cycle percentage
setPwmPeriod( port, period )
- params
- port: PWM / Analog output port 0 - 3
- period: The period value
- returns
- none
Sets the period of the specified PWM / Analog output port to the specified period
setAnalogOut( port, voltage )
- params
- port: PWM / Analog output port 0 - 3
- voltage: the specified output voltage ( 0 - 5v)
- returns
- none
Sets the output voltage of the specified PWM / Analog output port to the specified period. A convenience function equivalent to setPwmDutyCycle that translates voltage to PWM percentage.