CodeUC HRI2  v2.0
Microcontroller firmware of the board used during the HRI labs.
Functions
Driver / Strain gauge

Driver for a strain gauge. More...

Functions

void sg_Init (AdcChannel channel)
 Initialize the strain gauge driver. More...
 
float32_t sg_Get (void)
 Return the measured force on the paddle. More...
 

Detailed Description

Driver for a strain gauge.

This driver uses an ADC input, ANIN1 or ANIN2 (see ADC). To use this, connect wire the sensor as this:

Set the sensitivity switches to +-33mV.

Call sg_Init() first in the initialization code. Then, call sg_Get() to get the force.

Function Documentation

float32_t sg_Get ( void  )

Return the measured force on the paddle.

Return values
Theforce applied to the top of the paddle [N].
Warning
this function is not implemented yet, and returns actually the raw voltage from the sensor, instead of the ready-to-use force.
void sg_Init ( AdcChannel  channel)

Initialize the strain gauge driver.

Parameters
channelthe ADC channel the strain gauge is wired to (0 or 1).