CodeUC HRI2 v2.0 Microcontroller firmware of the board used during the HRI labs.

- Main Page
- Modules
- Data Structures
- Files

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:

- sensor + -> +5V (pin 1 or 5 of J2).
- sensor - -> GND (pin 2 or 6 of J2).
- sensor sense -> ANINX+ (pin 3 or 7 of J2).
- 2.5V (with a voltage divider between 5V and GND) -> ANINX- (pin 4 or 8 of J2).

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

  The | force 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

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