SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
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.

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Quimica Raymond Chang 12va Edicion___pdf
Quimica Raymond Chang 12va Edicion___pdfQuimica Raymond Chang 12va Edicion___pdf
Quimica Raymond Chang 12va Edicion___pdfs7yl3dr4g0n01
 
Elaboración de la estructura del ADN y ARN en papel.pdf
Elaboración de la estructura del ADN y ARN en papel.pdfElaboración de la estructura del ADN y ARN en papel.pdf
Elaboración de la estructura del ADN y ARN en papel.pdfKEVINYOICIAQUINOSORI
 
Magnetismo y electromagnetismo principios
Magnetismo y electromagnetismo principiosMagnetismo y electromagnetismo principios
Magnetismo y electromagnetismo principiosMarceloQuisbert6
 
PostgreSQL on Kubernetes Using GitOps and ArgoCD
PostgreSQL on Kubernetes Using GitOps and ArgoCDPostgreSQL on Kubernetes Using GitOps and ArgoCD
PostgreSQL on Kubernetes Using GitOps and ArgoCDEdith Puclla
 
hitos del desarrollo psicomotor en niños.docx
hitos del desarrollo psicomotor en niños.docxhitos del desarrollo psicomotor en niños.docx
hitos del desarrollo psicomotor en niños.docxMarcelaArancibiaRojo
 
CAPITULO 4 ANODIZADO DE ALUMINIO ,OBTENCION Y PROCESO
CAPITULO 4 ANODIZADO DE ALUMINIO ,OBTENCION Y PROCESOCAPITULO 4 ANODIZADO DE ALUMINIO ,OBTENCION Y PROCESO
CAPITULO 4 ANODIZADO DE ALUMINIO ,OBTENCION Y PROCESOLUISDAVIDVIZARRETARA
 
MODIFICADO - CAPITULO II DISEÑO SISMORRESISTENTE DE VIGAS Y COLUMNAS.pdf
MODIFICADO - CAPITULO II DISEÑO SISMORRESISTENTE DE VIGAS Y COLUMNAS.pdfMODIFICADO - CAPITULO II DISEÑO SISMORRESISTENTE DE VIGAS Y COLUMNAS.pdf
MODIFICADO - CAPITULO II DISEÑO SISMORRESISTENTE DE VIGAS Y COLUMNAS.pdfvladimirpaucarmontes
 
ECONOMIA APLICADA SEMANA 555555555544.pdf
ECONOMIA APLICADA SEMANA 555555555544.pdfECONOMIA APLICADA SEMANA 555555555544.pdf
ECONOMIA APLICADA SEMANA 555555555544.pdfmatepura
 
Clase 7 MECÁNICA DE FLUIDOS 2 INGENIERIA CIVIL
Clase 7 MECÁNICA DE FLUIDOS 2 INGENIERIA CIVILClase 7 MECÁNICA DE FLUIDOS 2 INGENIERIA CIVIL
Clase 7 MECÁNICA DE FLUIDOS 2 INGENIERIA CIVILProblemSolved
 
osciloscopios Mediciones Electricas ingenieria.pdf
osciloscopios Mediciones Electricas ingenieria.pdfosciloscopios Mediciones Electricas ingenieria.pdf
osciloscopios Mediciones Electricas ingenieria.pdfIvanRetambay
 
ECONOMIA APLICADA SEMANA 555555555555555555.pdf
ECONOMIA APLICADA SEMANA 555555555555555555.pdfECONOMIA APLICADA SEMANA 555555555555555555.pdf
ECONOMIA APLICADA SEMANA 555555555555555555.pdffredyflores58
 
04. Sistema de fuerzas equivalentes II - UCV 2024 II.pdf
04. Sistema de fuerzas equivalentes II - UCV 2024 II.pdf04. Sistema de fuerzas equivalentes II - UCV 2024 II.pdf
04. Sistema de fuerzas equivalentes II - UCV 2024 II.pdfCristhianZetaNima
 
CLASe número 4 fotogrametria Y PARALAJE.pptx
CLASe número 4 fotogrametria Y PARALAJE.pptxCLASe número 4 fotogrametria Y PARALAJE.pptx
CLASe número 4 fotogrametria Y PARALAJE.pptxbingoscarlet
 
Voladura Controlada Sobrexcavación (como se lleva a cabo una voladura)
Voladura Controlada  Sobrexcavación (como se lleva a cabo una voladura)Voladura Controlada  Sobrexcavación (como se lleva a cabo una voladura)
Voladura Controlada Sobrexcavación (como se lleva a cabo una voladura)ssuser563c56
 
UNIDAD 3 ELECTRODOS.pptx para biopotenciales
UNIDAD 3 ELECTRODOS.pptx para biopotencialesUNIDAD 3 ELECTRODOS.pptx para biopotenciales
UNIDAD 3 ELECTRODOS.pptx para biopotencialesElianaCceresTorrico
 
Sesión N°2_Curso_Ingeniería_Sanitaria.pdf
Sesión N°2_Curso_Ingeniería_Sanitaria.pdfSesión N°2_Curso_Ingeniería_Sanitaria.pdf
Sesión N°2_Curso_Ingeniería_Sanitaria.pdfannavarrom
 
Reporte de simulación de flujo del agua en un volumen de control MNVA.pdf
Reporte de simulación de flujo del agua en un volumen de control MNVA.pdfReporte de simulación de flujo del agua en un volumen de control MNVA.pdf
Reporte de simulación de flujo del agua en un volumen de control MNVA.pdfMikkaelNicolae
 
INTEGRALES TRIPLES CLASE TEORICA Y PRÁCTICA
INTEGRALES TRIPLES CLASE TEORICA Y PRÁCTICAINTEGRALES TRIPLES CLASE TEORICA Y PRÁCTICA
INTEGRALES TRIPLES CLASE TEORICA Y PRÁCTICAJOSLUISCALLATAENRIQU
 
PPT ELABORARACION DE ADOBES 2023 (1).pdf
PPT ELABORARACION DE ADOBES 2023 (1).pdfPPT ELABORARACION DE ADOBES 2023 (1).pdf
PPT ELABORARACION DE ADOBES 2023 (1).pdfalexquispenieto2
 
Sesión 02 TIPOS DE VALORIZACIONES CURSO Cersa
Sesión 02 TIPOS DE VALORIZACIONES CURSO CersaSesión 02 TIPOS DE VALORIZACIONES CURSO Cersa
Sesión 02 TIPOS DE VALORIZACIONES CURSO CersaXimenaFallaLecca1
 

Kürzlich hochgeladen (20)

Quimica Raymond Chang 12va Edicion___pdf
Quimica Raymond Chang 12va Edicion___pdfQuimica Raymond Chang 12va Edicion___pdf
Quimica Raymond Chang 12va Edicion___pdf
 
Elaboración de la estructura del ADN y ARN en papel.pdf
Elaboración de la estructura del ADN y ARN en papel.pdfElaboración de la estructura del ADN y ARN en papel.pdf
Elaboración de la estructura del ADN y ARN en papel.pdf
 
Magnetismo y electromagnetismo principios
Magnetismo y electromagnetismo principiosMagnetismo y electromagnetismo principios
Magnetismo y electromagnetismo principios
 
PostgreSQL on Kubernetes Using GitOps and ArgoCD
PostgreSQL on Kubernetes Using GitOps and ArgoCDPostgreSQL on Kubernetes Using GitOps and ArgoCD
PostgreSQL on Kubernetes Using GitOps and ArgoCD
 
hitos del desarrollo psicomotor en niños.docx
hitos del desarrollo psicomotor en niños.docxhitos del desarrollo psicomotor en niños.docx
hitos del desarrollo psicomotor en niños.docx
 
CAPITULO 4 ANODIZADO DE ALUMINIO ,OBTENCION Y PROCESO
CAPITULO 4 ANODIZADO DE ALUMINIO ,OBTENCION Y PROCESOCAPITULO 4 ANODIZADO DE ALUMINIO ,OBTENCION Y PROCESO
CAPITULO 4 ANODIZADO DE ALUMINIO ,OBTENCION Y PROCESO
 
MODIFICADO - CAPITULO II DISEÑO SISMORRESISTENTE DE VIGAS Y COLUMNAS.pdf
MODIFICADO - CAPITULO II DISEÑO SISMORRESISTENTE DE VIGAS Y COLUMNAS.pdfMODIFICADO - CAPITULO II DISEÑO SISMORRESISTENTE DE VIGAS Y COLUMNAS.pdf
MODIFICADO - CAPITULO II DISEÑO SISMORRESISTENTE DE VIGAS Y COLUMNAS.pdf
 
ECONOMIA APLICADA SEMANA 555555555544.pdf
ECONOMIA APLICADA SEMANA 555555555544.pdfECONOMIA APLICADA SEMANA 555555555544.pdf
ECONOMIA APLICADA SEMANA 555555555544.pdf
 
Clase 7 MECÁNICA DE FLUIDOS 2 INGENIERIA CIVIL
Clase 7 MECÁNICA DE FLUIDOS 2 INGENIERIA CIVILClase 7 MECÁNICA DE FLUIDOS 2 INGENIERIA CIVIL
Clase 7 MECÁNICA DE FLUIDOS 2 INGENIERIA CIVIL
 
osciloscopios Mediciones Electricas ingenieria.pdf
osciloscopios Mediciones Electricas ingenieria.pdfosciloscopios Mediciones Electricas ingenieria.pdf
osciloscopios Mediciones Electricas ingenieria.pdf
 
ECONOMIA APLICADA SEMANA 555555555555555555.pdf
ECONOMIA APLICADA SEMANA 555555555555555555.pdfECONOMIA APLICADA SEMANA 555555555555555555.pdf
ECONOMIA APLICADA SEMANA 555555555555555555.pdf
 
04. Sistema de fuerzas equivalentes II - UCV 2024 II.pdf
04. Sistema de fuerzas equivalentes II - UCV 2024 II.pdf04. Sistema de fuerzas equivalentes II - UCV 2024 II.pdf
04. Sistema de fuerzas equivalentes II - UCV 2024 II.pdf
 
CLASe número 4 fotogrametria Y PARALAJE.pptx
CLASe número 4 fotogrametria Y PARALAJE.pptxCLASe número 4 fotogrametria Y PARALAJE.pptx
CLASe número 4 fotogrametria Y PARALAJE.pptx
 
Voladura Controlada Sobrexcavación (como se lleva a cabo una voladura)
Voladura Controlada  Sobrexcavación (como se lleva a cabo una voladura)Voladura Controlada  Sobrexcavación (como se lleva a cabo una voladura)
Voladura Controlada Sobrexcavación (como se lleva a cabo una voladura)
 
UNIDAD 3 ELECTRODOS.pptx para biopotenciales
UNIDAD 3 ELECTRODOS.pptx para biopotencialesUNIDAD 3 ELECTRODOS.pptx para biopotenciales
UNIDAD 3 ELECTRODOS.pptx para biopotenciales
 
Sesión N°2_Curso_Ingeniería_Sanitaria.pdf
Sesión N°2_Curso_Ingeniería_Sanitaria.pdfSesión N°2_Curso_Ingeniería_Sanitaria.pdf
Sesión N°2_Curso_Ingeniería_Sanitaria.pdf
 
Reporte de simulación de flujo del agua en un volumen de control MNVA.pdf
Reporte de simulación de flujo del agua en un volumen de control MNVA.pdfReporte de simulación de flujo del agua en un volumen de control MNVA.pdf
Reporte de simulación de flujo del agua en un volumen de control MNVA.pdf
 
INTEGRALES TRIPLES CLASE TEORICA Y PRÁCTICA
INTEGRALES TRIPLES CLASE TEORICA Y PRÁCTICAINTEGRALES TRIPLES CLASE TEORICA Y PRÁCTICA
INTEGRALES TRIPLES CLASE TEORICA Y PRÁCTICA
 
PPT ELABORARACION DE ADOBES 2023 (1).pdf
PPT ELABORARACION DE ADOBES 2023 (1).pdfPPT ELABORARACION DE ADOBES 2023 (1).pdf
PPT ELABORARACION DE ADOBES 2023 (1).pdf
 
Sesión 02 TIPOS DE VALORIZACIONES CURSO Cersa
Sesión 02 TIPOS DE VALORIZACIONES CURSO CersaSesión 02 TIPOS DE VALORIZACIONES CURSO Cersa
Sesión 02 TIPOS DE VALORIZACIONES CURSO Cersa
 

Empfohlen

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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 
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...Applitools
 
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 WorkGetSmarter
 

Empfohlen (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.