Skip to Content
Using LEDs, LCDs and GLCDs in Microcontroller Projects
book

Using LEDs, LCDs and GLCDs in Microcontroller Projects

by Dogan Ibrahim
November 2012
Intermediate to advanced
496 pages
12h 2m
English
Wiley
Content preview from Using LEDs, LCDs and GLCDs in Microcontroller Projects

13.1 PROJECT 13.1 – Touch Screen LED ON-OFF

13.1.1 Project Description

This is perhaps the simplest GLCD project utilising touch screen. In this project, an LED is connected to pin RC7 of the microcontroller. Two buttons are placed on the screen, labelled ON and OFF. Touching the ON button will turn the LED ON. Similarly, touching the OFF button will turn the LED OFF.

The principle of operation of a touch screen is such that, as shown in Figure 13.1, if one side of a layer is connected to +V and the other side to ground, a potential gradient results on the screen layer, and the voltage at any point on this layer becomes directly proportional to the distance from the +V side.

Figure 13.1 Voltage gradient in a screen layer

img

In a 4-wire resistive touch screen, two measurements are made one after the other one to determine the X and Y co-ordinates of the point touched by the user. Figure 13.2a shows how the X co-ordinate can be determined. Here, the right- and left-hand sides of the top layer can be connected to +V and ground, respectively. The bottom layer can then be used to sense and measure the voltage at the point touched by the user. An A/D converter is used to convert this voltage to digital and then determine the X co-ordinate. Similarly, Figure 13.2b shows how the Y co-ordinate can be determined. Here, the upper and lower sides of the bottom layer can be connected to +V and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Practical AVR Microcontrollers: Games, Gadgets, and Home Automation with the Microcontroller Used in Arduino

Practical AVR Microcontrollers: Games, Gadgets, and Home Automation with the Microcontroller Used in Arduino

Alan Trevennor

Publisher Resources

ISBN: 9781118361030Purchase book