SlideShare una empresa de Scribd logo
1 de 3
Descargar para leer sin conexión
www.novellius.com 
Teclado Matricial 4x4 
Teclado matricial de membrana adherible de 4x4 caracteres, 
ideal para proyectos de microcontrol. 
Características 
• 16 botones organizados en 4 filas por 4 columnas 
• Teclado de membrana adherible 
• Voltaje máximo 24 V 
• Corriente máxima 30 mA 
• Dimensiones del Teclado 70 x 79 mm 
• Dimensiones de la membrana 22 x 69 mm 
Circuito Esquemático 
2 3 A 
5 6 B 
1 
7 8 9 C 
* 0 # D 
Conexión 
4 
FILA 1 
FILA 2 
FILA 3 
FILA 4 
COL 1 
COL 2 
COL 3 
COL 4 
Conecta directamente el teclado al puerto B de la TEMPIC-45 como se muestra a continuación
www.novellius.com 
Código de Ejemplo para la TEMPIC-45 
1. #include <18F4550.h> 
2. #fuses HSPLL, PLL5, MCLR 
3. #use delay (clock=20MHz) 
4. #include <lcd.c> 
5. #include “kbd_lib.c” 
6. char c; 
7. void main() { 
8. kbd_init(); 
9. lcd_init(); 
10. printf(lcd_putc, “Esperando tecla”); 
11. while(1) { 
12. c = kbd_getc(); 
13. if(c != 0) { 
14. printf(lcd_putc, “fPresionado. %c”, c); 
15. } 
16. } 
17. } 
Código 5 
5. #include “kbd_lib.c” 
Esta línea incluye la librería modificada para poder conectar el teclado matricial directamente al 
puerto B del Microcontrolador. Puedes descargar este archivo desde: 
https://www.dropbox.com/s/x3ku38a8klihnm0/kbd_lib.c?dl=0 
Código 8 
8. kbd_init(); 
Esta función habilita las resistencias de pull up del puerto B de la TEMPIC-45. Recuerda siempre 
invocar esta función antes de intentar leer un caracter del teclado. 
Código 12-15 
12. c = kbd_getc(); 
13. if(c != 0) { 
14. printf(lcd_putc, “fPresionado. %c”, c); 
15. } 
La línea 12 almacena el caracter recibido en la variable c, mediante la función kbd_getc(). Debido 
que la librería estipula que si la función retorna el número cero no se ha recibido ningún caracter. 
Es necesario probar cuando la variable c sea diferente de cero (línea 13), ya que en caso afirmativo 
la línea 14 imprime en la pantalla LCD el caracter pulsado
www.novellius.com 
Escríbenos tus inquietudes y pregunta 
contacto@novellius.com 
¿Tienes dudas acerca de este ejemplo? 
Échale un vistazo a nuestro Curso Intermedio de Microcontroladores, el cual te impartimos a tu 
propio ritmo y con instructores calificados.

Más contenido relacionado

Último

Tipos de suelo y su clasificación y ejemplos
Tipos de suelo y su clasificación y ejemplosTipos de suelo y su clasificación y ejemplos
Tipos de suelo y su clasificación y ejemplos
andersonsubero28
 
SESION 11 SUPERVISOR SSOMA SEGURIDAD Y SALUD OCUPACIONAL
SESION 11 SUPERVISOR SSOMA SEGURIDAD Y SALUD OCUPACIONALSESION 11 SUPERVISOR SSOMA SEGURIDAD Y SALUD OCUPACIONAL
SESION 11 SUPERVISOR SSOMA SEGURIDAD Y SALUD OCUPACIONAL
EdwinC23
 
UC Fundamentos de tuberías en equipos de refrigeración m.pdf
UC Fundamentos de tuberías en equipos de refrigeración m.pdfUC Fundamentos de tuberías en equipos de refrigeración m.pdf
UC Fundamentos de tuberías en equipos de refrigeración m.pdf
refrielectriccarlyz
 
INSUMOS QUIMICOS Y BIENES FISCALIZADOS POR LA SUNAT
INSUMOS QUIMICOS Y BIENES FISCALIZADOS POR LA SUNATINSUMOS QUIMICOS Y BIENES FISCALIZADOS POR LA SUNAT
INSUMOS QUIMICOS Y BIENES FISCALIZADOS POR LA SUNAT
evercoyla
 

Último (20)

Resistencia-a-los-antimicrobianos--laboratorio-al-cuidado-del-paciente_Marcel...
Resistencia-a-los-antimicrobianos--laboratorio-al-cuidado-del-paciente_Marcel...Resistencia-a-los-antimicrobianos--laboratorio-al-cuidado-del-paciente_Marcel...
Resistencia-a-los-antimicrobianos--laboratorio-al-cuidado-del-paciente_Marcel...
 
Tipos de suelo y su clasificación y ejemplos
Tipos de suelo y su clasificación y ejemplosTipos de suelo y su clasificación y ejemplos
Tipos de suelo y su clasificación y ejemplos
 
1. Equipos Primarios de una Subestaciones electricas
1. Equipos Primarios de una Subestaciones electricas1. Equipos Primarios de una Subestaciones electricas
1. Equipos Primarios de una Subestaciones electricas
 
Presentación Instrumentos de Medicion Electricos.pptx
Presentación Instrumentos de Medicion Electricos.pptxPresentación Instrumentos de Medicion Electricos.pptx
Presentación Instrumentos de Medicion Electricos.pptx
 
2. Cristaloquimica. ingenieria geologica
2. Cristaloquimica. ingenieria geologica2. Cristaloquimica. ingenieria geologica
2. Cristaloquimica. ingenieria geologica
 
Video sustentación GA2- 240201528-AA3-EV01.pptx
Video sustentación GA2- 240201528-AA3-EV01.pptxVideo sustentación GA2- 240201528-AA3-EV01.pptx
Video sustentación GA2- 240201528-AA3-EV01.pptx
 
Auditoría de Sistemas de Gestión
Auditoría    de   Sistemas     de GestiónAuditoría    de   Sistemas     de Gestión
Auditoría de Sistemas de Gestión
 
GUIA DE SEGURIDAD PARA VENTILACION DE MINAS-POSITIVA.pdf
GUIA DE SEGURIDAD PARA VENTILACION DE MINAS-POSITIVA.pdfGUIA DE SEGURIDAD PARA VENTILACION DE MINAS-POSITIVA.pdf
GUIA DE SEGURIDAD PARA VENTILACION DE MINAS-POSITIVA.pdf
 
ATS-FORMATO cara.pdf PARA TRABAJO SEGURO
ATS-FORMATO cara.pdf  PARA TRABAJO SEGUROATS-FORMATO cara.pdf  PARA TRABAJO SEGURO
ATS-FORMATO cara.pdf PARA TRABAJO SEGURO
 
SESION 11 SUPERVISOR SSOMA SEGURIDAD Y SALUD OCUPACIONAL
SESION 11 SUPERVISOR SSOMA SEGURIDAD Y SALUD OCUPACIONALSESION 11 SUPERVISOR SSOMA SEGURIDAD Y SALUD OCUPACIONAL
SESION 11 SUPERVISOR SSOMA SEGURIDAD Y SALUD OCUPACIONAL
 
UC Fundamentos de tuberías en equipos de refrigeración m.pdf
UC Fundamentos de tuberías en equipos de refrigeración m.pdfUC Fundamentos de tuberías en equipos de refrigeración m.pdf
UC Fundamentos de tuberías en equipos de refrigeración m.pdf
 
DIAPOSITIVAS DE SEGURIDAD Y SALUD EN EL TRABAJO
DIAPOSITIVAS DE SEGURIDAD Y SALUD EN EL TRABAJODIAPOSITIVAS DE SEGURIDAD Y SALUD EN EL TRABAJO
DIAPOSITIVAS DE SEGURIDAD Y SALUD EN EL TRABAJO
 
27311861-Cuencas-sedimentarias-en-Colombia.ppt
27311861-Cuencas-sedimentarias-en-Colombia.ppt27311861-Cuencas-sedimentarias-en-Colombia.ppt
27311861-Cuencas-sedimentarias-en-Colombia.ppt
 
Matrices Matemáticos universitario pptx
Matrices  Matemáticos universitario pptxMatrices  Matemáticos universitario pptx
Matrices Matemáticos universitario pptx
 
NTC 3883 análisis sensorial. metodología. prueba duo-trio.pdf
NTC 3883 análisis sensorial. metodología. prueba duo-trio.pdfNTC 3883 análisis sensorial. metodología. prueba duo-trio.pdf
NTC 3883 análisis sensorial. metodología. prueba duo-trio.pdf
 
ESPECIFICACIONES TECNICAS COMPLEJO DEPORTIVO
ESPECIFICACIONES TECNICAS COMPLEJO DEPORTIVOESPECIFICACIONES TECNICAS COMPLEJO DEPORTIVO
ESPECIFICACIONES TECNICAS COMPLEJO DEPORTIVO
 
5. MATERIALES petreos para concreto.pdf.
5. MATERIALES petreos para concreto.pdf.5. MATERIALES petreos para concreto.pdf.
5. MATERIALES petreos para concreto.pdf.
 
portafolio final manco 2 1816827 portafolio de evidencias
portafolio final manco 2 1816827 portafolio de evidenciasportafolio final manco 2 1816827 portafolio de evidencias
portafolio final manco 2 1816827 portafolio de evidencias
 
TRABAJO N°2 GERENCIA DE PROYECTOS (4).pdf
TRABAJO N°2 GERENCIA DE PROYECTOS (4).pdfTRABAJO N°2 GERENCIA DE PROYECTOS (4).pdf
TRABAJO N°2 GERENCIA DE PROYECTOS (4).pdf
 
INSUMOS QUIMICOS Y BIENES FISCALIZADOS POR LA SUNAT
INSUMOS QUIMICOS Y BIENES FISCALIZADOS POR LA SUNATINSUMOS QUIMICOS Y BIENES FISCALIZADOS POR LA SUNAT
INSUMOS QUIMICOS Y BIENES FISCALIZADOS POR LA SUNAT
 

Destacado

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Control de un teclado matricial 4x4 en CCS con PIC

  • 1. www.novellius.com Teclado Matricial 4x4 Teclado matricial de membrana adherible de 4x4 caracteres, ideal para proyectos de microcontrol. Características • 16 botones organizados en 4 filas por 4 columnas • Teclado de membrana adherible • Voltaje máximo 24 V • Corriente máxima 30 mA • Dimensiones del Teclado 70 x 79 mm • Dimensiones de la membrana 22 x 69 mm Circuito Esquemático 2 3 A 5 6 B 1 7 8 9 C * 0 # D Conexión 4 FILA 1 FILA 2 FILA 3 FILA 4 COL 1 COL 2 COL 3 COL 4 Conecta directamente el teclado al puerto B de la TEMPIC-45 como se muestra a continuación
  • 2. www.novellius.com Código de Ejemplo para la TEMPIC-45 1. #include <18F4550.h> 2. #fuses HSPLL, PLL5, MCLR 3. #use delay (clock=20MHz) 4. #include <lcd.c> 5. #include “kbd_lib.c” 6. char c; 7. void main() { 8. kbd_init(); 9. lcd_init(); 10. printf(lcd_putc, “Esperando tecla”); 11. while(1) { 12. c = kbd_getc(); 13. if(c != 0) { 14. printf(lcd_putc, “fPresionado. %c”, c); 15. } 16. } 17. } Código 5 5. #include “kbd_lib.c” Esta línea incluye la librería modificada para poder conectar el teclado matricial directamente al puerto B del Microcontrolador. Puedes descargar este archivo desde: https://www.dropbox.com/s/x3ku38a8klihnm0/kbd_lib.c?dl=0 Código 8 8. kbd_init(); Esta función habilita las resistencias de pull up del puerto B de la TEMPIC-45. Recuerda siempre invocar esta función antes de intentar leer un caracter del teclado. Código 12-15 12. c = kbd_getc(); 13. if(c != 0) { 14. printf(lcd_putc, “fPresionado. %c”, c); 15. } La línea 12 almacena el caracter recibido en la variable c, mediante la función kbd_getc(). Debido que la librería estipula que si la función retorna el número cero no se ha recibido ningún caracter. Es necesario probar cuando la variable c sea diferente de cero (línea 13), ya que en caso afirmativo la línea 14 imprime en la pantalla LCD el caracter pulsado
  • 3. www.novellius.com Escríbenos tus inquietudes y pregunta contacto@novellius.com ¿Tienes dudas acerca de este ejemplo? Échale un vistazo a nuestro Curso Intermedio de Microcontroladores, el cual te impartimos a tu propio ritmo y con instructores calificados.