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
Diff: main.cpp
- Revision:
- 3:a7b991611a74
- Parent:
- 2:ad0b044d0a10
--- a/main.cpp Sat Dec 04 11:31:07 2010 +0000 +++ b/main.cpp Thu May 02 18:31:31 2019 +0000 @@ -1,10 +1,26 @@ -// Hello World! for the TextLCD +#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 -#include "mbed.h" -#include "TextLCD.h" +PwmOut gLed(LED_GREEN); // pwm out +PwmOut rLed(LED_RED); -TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7 +int main() +{ + slcd.printf("lcd "); + wait(2); // delay 2 sec -int main() { - lcd.printf("Hello World!\n"); -} + 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); + } +} \ No newline at end of file