SPIKE-RT C API Reference [English]
An RTOS-based software platform for LEGO® Education SPIKE™.
Loading...
Searching...
No Matches
forcesensor.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2/*
3 * API for force sensors
4 *
5 * Copyright (c) 2022 Embedded and Real-Time Systems Laboratory,
6 * Graduate School of Information Science, Nagoya Univ., JAPAN
7 */
8
33#ifndef _PUP_FORCE_SENSOR_H_
34#define _PUP_FORCE_SENSOR_H_
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40#include <stdint.h>
41#include <spike/pup_device.h>
42
56pup_device_t *pup_force_sensor_get_device(pbio_port_id_t port);
57
71
84
100bool pup_force_sensor_pressed(pup_device_t *pdev, float force);
101
116
117#ifdef __cplusplus
118}
119#endif
120
121#endif // _PUP_FORCE_SENSOR_H_
122
bool pup_force_sensor_pressed(pup_device_t *pdev, float force)
Check a force sensor's button is pressed.
Definition forcesensor.c:83
pup_device_t * pup_force_sensor_get_device(pbio_port_id_t port)
Get the PUP device pointer of the force sensor specified with the port ID.
Definition forcesensor.c:54
float pup_force_sensor_force(pup_device_t *pdev)
Get the force detected by a force sensor.
Definition forcesensor.c:74
bool pup_force_sensor_touched(pup_device_t *pdev)
Check a force sensor's button is touched.
Definition forcesensor.c:89
float pup_force_sensor_distance(pup_device_t *pdev)
Get the distance how much force sensor's button has moved.
Definition forcesensor.c:79
Definition pup_device.c:21