Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FRDM_MMA8451Q KL46Z-USBHost MAG3110 SocketModem TSI mbed FATFileSystem
Fork of AxedaGo-Freescal_FRDM-KL46Z by
TSISensor Class Reference
#include <TSISensor.h>
Public Member Functions | |
TSISensor () | |
Initialize the TSI Touch Sensor. | |
float | readPercentage () |
Read Touch Sensor percentage value. | |
uint8_t | readDistance () |
Read Touch Sensor distance. |
Detailed Description
TSISensor example.
#include "mbed.h" #include "TSISensor.h" int main(void) { PwmOut led(LED_GREEN); TSISensor tsi; while (true) { led = 1.0 - tsi.readPercentage(); wait(0.1); } }
Definition at line 45 of file TSISensor.h.
Constructor & Destructor Documentation
TSISensor | ( | ) |
Initialize the TSI Touch Sensor.
Definition at line 103 of file TSISensor.cpp.
Member Function Documentation
uint8_t readDistance | ( | ) |
Read Touch Sensor distance.
- Returns:
- distance in mm. The value is between [0 ... 40]
Definition at line 215 of file TSISensor.cpp.
float readPercentage | ( | ) |
Read Touch Sensor percentage value.
- Returns:
- percentage value between [0 ... 1]
Definition at line 210 of file TSISensor.cpp.
Generated on Wed Jul 13 2022 03:01:23 by
