


Process
Fig. 4: Image showing connecting wires attached to touch screen



Fig. 8: Image of breakout board
Fig. 9: Typical Image of Breakout Board for 4-wire resistive touch screen
Fig. 10: Image showing cut made of electric tape to cover connections of touch screen


Working

ATMega16 Pin
|
Touch Screen Breakout Board Pin
|
Pin Configuration for reading X co-ordinate
|
Pin Configuration for reading Y co-ordinate
|
PA1
|
Y1
|
–
|
5V
|
PA2
|
X2
|
GND
|
–
|
PA3
|
Y2
|
ADC
|
GND
|
PA4
|
X1
|
5V
|
ADC
|
Project Source Code
###
/* * touchscrn.c * * Created: 9/14/2013 8:58:01 AM * Author: Ganesh Selvaraj */
#define F_CPU 16000000UL
#define y1 PA1
#define x2 PA2
#define y2 PA3
#define x1 PA4#define USART_BAUDRATE 9600
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)
#include <avr/io.h>
#include <util/delay.h>void Init()
{
UCSRB |= (1 << RXEN) | (1 << TXEN); // Enable transmission and reception
UCSRC |= (1 << URSEL) | (1<<USBS) | (1 << UCSZ0) | (1 << UCSZ1);
// Use 8-bit character sizes
UBRRL = BAUD_PRESCALE;
UBRRH = (BAUD_PRESCALE >> 8);
}
unsigned int RdChar()
{
while ((UCSRA & (1 << RXC)) == 0); // wait until data has been received
return(UDR); // return the byte
}void WrChar(unsigned char d)
{
while ((UCSRA & (1 << UDRE)) == 0); // wait till UDR is ready
UDR = d; // send data
}
void WrString(const char *msg)
{
while(*msg!='