SPIKE-RT C API Reference [English]
An RTOS-based software platform for LEGO® Education SPIKE™.
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#include <stdint.h>
37#include <spike/pup_device.h>
38
52pup_device_t *pup_force_sensor_get_device(pbio_port_id_t port);
53
67
80
96bool pup_force_sensor_pressed(pup_device_t *pdev, float force);
97
112
113#endif // _PUP_FORCE_SENSOR_H_
114
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