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.
Fork of frdm_tsi_slider by
main.cpp@2:b13f658fd99f, 2014-02-23 (annotated)
- Committer:
- Kojto
- Date:
- Sun Feb 23 18:32:55 2014 +0000
- Revision:
- 2:b13f658fd99f
- Parent:
- 0:5d433bc41aba
- Child:
- 3:900d47561319
Electrodes are part of Analog slider, app does not need to create own instances
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Kojto | 0:5d433bc41aba | 1 | #include "mbed.h" |
| Kojto | 0:5d433bc41aba | 2 | #include "tsi_sensor.h" |
| Kojto | 0:5d433bc41aba | 3 | |
| Kojto | 2:b13f658fd99f | 4 | /* This defines will be replaced by PinNames soon */ |
| Kojto | 2:b13f658fd99f | 5 | #if defined (TARGET_KL25Z) || defined (TARGET_KL46Z) |
| Kojto | 0:5d433bc41aba | 6 | #define ELEC0 9 |
| Kojto | 0:5d433bc41aba | 7 | #define ELEC1 10 |
| Kojto | 0:5d433bc41aba | 8 | #elif defined (TARGET_KL05Z) |
| Kojto | 0:5d433bc41aba | 9 | #define ELEC0 9 |
| Kojto | 0:5d433bc41aba | 10 | #define ELEC1 8 |
| Kojto | 0:5d433bc41aba | 11 | #else |
| Kojto | 0:5d433bc41aba | 12 | #error TARGET NOT DEFINED |
| Kojto | 0:5d433bc41aba | 13 | #endif |
| Kojto | 0:5d433bc41aba | 14 | |
| Kojto | 0:5d433bc41aba | 15 | int main(void) { |
| Kojto | 0:5d433bc41aba | 16 | PwmOut led(LED_GREEN); |
| Kojto | 2:b13f658fd99f | 17 | TSIAnalogSlider tsi(ELEC0, ELEC1, 40); |
| Kojto | 0:5d433bc41aba | 18 | |
| Kojto | 0:5d433bc41aba | 19 | while (true) { |
| Kojto | 0:5d433bc41aba | 20 | led = 1.0 - tsi.readPercentage(); |
| Kojto | 0:5d433bc41aba | 21 | wait(0.1); |
| Kojto | 0:5d433bc41aba | 22 | } |
| Kojto | 0:5d433bc41aba | 23 | } |
