Example program to control the brightness of an LED using the touch sensor interface
Dependents: FRDM-KL46Z_LCD_Test FRDM-KL46Z_LCD_Test FRDM-KL46Z_I2C-Scanner
Legacy Warning
This is an mbed 2 example. To learn more about mbed OS 5, visit the docs.
main.cpp@5:b44f5f02b879, 2013-05-09 (annotated)
- Committer:
- mbed_official
- Date:
- Thu May 09 09:26:46 2013 +0000
- Revision:
- 5:b44f5f02b879
- Parent:
- 1:51b1b688179a
Fork TSI library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 0:0f00f07ebde0 | 1 | #include "mbed.h" |
chris | 1:51b1b688179a | 2 | #include "TSISensor.h" |
emilmont | 0:0f00f07ebde0 | 3 | |
emilmont | 0:0f00f07ebde0 | 4 | int main(void) { |
chris | 1:51b1b688179a | 5 | PwmOut led(LED_GREEN); |
chris | 1:51b1b688179a | 6 | TSISensor tsi; |
emilmont | 0:0f00f07ebde0 | 7 | |
emilmont | 0:0f00f07ebde0 | 8 | while (true) { |
chris | 1:51b1b688179a | 9 | led = 1.0 - tsi.readPercentage(); |
chris | 1:51b1b688179a | 10 | wait(0.1); |
emilmont | 0:0f00f07ebde0 | 11 | } |
chris | 1:51b1b688179a | 12 | } |