manejo básico del teclado, usando la pantalla lcd.
Dependencies: FPointer TextLCD keypad mbed
Fork of Tarea3_Teclado_sonido by
main.cpp
- Committer:
- juanco
- Date:
- 2014-05-13
- Revision:
- 2:74e66e0bc451
- Parent:
- 1:4fa754f4522d
File content as of revision 2:74e66e0bc451:
#include "mbed.h" #include "keypad.h" #include "TextLCD.h" TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); // rs, e, d4-d7 DigitalOut Sonido(PTB8); PwmOut Pwm(PTA5); float pp=0.001; float Dd=0.1; char key,keyy; int C1=0x0F; // Define your own keypad values char Keytable[] = { '1', '2', '3', 'A', '4', '5', '6', 'B', '7', '8', '9', 'C', '*', '0', '#', 'D' }; //PWM int PWMmodule(float pp,float Dd) { Pwm.period(pp); Pwm.write(Dd); wait(0.1); Pwm.write(0); return 0; } uint32_t cbAfterInput(uint32_t Key) { PWMmodule(pp,Dd); key=Key; lcd.locate(0,0); lcd.printf("%c",Keytable[key]); return 0; } int main() { // r0 r1 r2 r3 c0 c1 c2 c3 Keypad keypad(PTA2,PTD4,PTD3,PTD1,PTD2,PTD0,PTD5,PTA13); keypad.CallAfterInput(&cbAfterInput); keypad.Start(); while (1) { } }