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: mbed tsi_sensor TextLCD SLCD
main.cpp
- Committer:
- ArturoSoto
- Date:
- 2019-05-02
- Revision:
- 3:a7b991611a74
- Parent:
- 2:ad0b044d0a10
File content as of revision 3:a7b991611a74:
#include "mbed.h" #include "SLCD.h" #include "tsi_sensor.h" BusOut Salidas(PTE16, PTE17, PTE18, PTE19, PTE20, PTE21, PTE22, PTE23); uint8_t Segmentos[]={0x81, 0xE7, 0x49, 0x43, 0x27, 0x13, 0x11, 0xC7, 0x01, 0x03, 0x05, 0x31, 0x99, 0x61, 0x19, 0x1D, 0x91, 0x35, 0xBD, 0xB3, 0x2D, 0xB9, 0x85, 0x75, 0x71, 0x0D, 0x07, 0x3D, 0x13, 0x39, 0xF1, 0xE1, 0xA1, 0x25, 0x37, 0x49}; SLCD slcd; TSIAnalogSlider slider(PTB16, PTB17, 100); // touch sensor PwmOut gLed(LED_GREEN); // pwm out PwmOut rLed(LED_RED); int main() { slcd.printf("lcd "); wait(2); // delay 2 sec while (1) { slcd.CharPosition = 0; //Salidas=Segmentos[]; // if we don't use it the value on the screen will be sliding slcd.printf("%1.3f",slider.readPercentage()); // print TSI_sensor value on LCD rLed = slider.readPercentage(); // set TSI_value to the PWM linked with LED gLed = 1.0 - slider.readPercentage(); wait_ms(10); } }