Saturday 28 September 2013

classes ad object(Q3)

Q . WAP to define a class Date which contains the data member , dd,mm, and yy.
     And , functions ,
              * readDate();
              * showDate();
              * increament();
              * decreament();
              * maxDays();
#include<iostream.h>
#include<conio.h>
class Date
{
     int dd,mm,yy;
     public:
     void readDate()
              {
                   cout<<endl<<"Enter the value of dd ,mm , and yy :";
                   cin>>dd>>mm>>yy;
              }

              void showDate() 
              {
                   cout<<endl<<dd<<":"<<mm<<":"<<yy;
                  }
              void increament ();
              void decreament(); 
                int maxDays();                       };

     int Date::maxDays()
     {
         
              switch(mm)
              {
                   case 1:
                   case 3:
                   case 5:
                   case 7:
                   case 8:
                   case 10:
                   case 12: 
                             return 31;
                   case 2:
                             if((yy%4==0&&yy%100!=0)||(yy%400==0))
                                  return 29;
                             else   
                                  return 28;
                   case 4:
                   case 6:
                   case 9:
                   case 11: 
                                  return 30;
          }
}
void Date::increament()
{  
          //increament the day
                  
              dd=dd+1;

          //check for the valid day range

              int max;

              max=maxDays();
              if(dd>max)
              {
//set day to the first day of the next month
          dd=1;
              //increament the month
                        mm=mm+1;
                        if(mm>12)
                        {
                             //set month to jan
                             mm=1;
                             //increament the year

                                  yy=yy+1;        
                  
                        }
              }
}

void Date::decreament()
{
         
          //decreament the day

              dd=dd-1;

          //check for the valid
              if(dd<1)
              {
                   //decreament the month
                    mm=mm-1;
                   if(mm<0)
                   {
                        //set month to dec
                        mm=12;
          //decreament the year

                             yy=yy-1;

                   }

                   //assign the day

                   dd=maxDays();

          }  
}

void main()
{
     Data ob;

     ob.readDate();

     ob.showDate();

     ob.increament();

     ob.showDate();

     ob.decreament();

     ob.showDate();

     getch();

}

Thursday 26 September 2013

classes and object (Q2.)

Q WAP to define a class Time , which contains the data member , hh,mm and ss and functions ,
          * readTime();
          * showTime();
          * increament();
          * decreament();
Valid range :
     hh= 0-23
     mm=0-59
     ss=0-59
#include<iostream.h>
#include<conio.h>
class Time
{
     int hh,mm,ss;

     public:
          void readTime()
          {
              cout<<endl<<"Enter the value of hh , mm, and ss :";
              cin>>hh>>mm>>ss;
          }

          void showTime()
          {
               cout<<endl<<hh<<":"<<mm<<":"<<ss;
          }

          void decreament();
    
          void increament();

};
     void Time::increament()
          {
          //increament the second
              ss=ss+1;
//check for the seconds valid range
              if(ss>59)
              {
                   //set seconds to 0
                   ss=0;
                   //increament the minutes

                   mm=mm+1;

                   //check for the minutes valid range

                   if(mm>59)
                   {
                        //set the minutes to 0

                        mm=0;

                        //increament the hours

                        hh=hh+1;

                        //check the hours valid range

                        if(hh>23)
                             hh=0;
                   }
               }
          }
    
     void Time::decreament()
     {
          //decrease the seconds by 1

          ss=ss-1;

          //check for the valid range

          if(ss<0)
          {
              //set seconds to maximum

              ss=59;

     //decreament the minutes by 1

              mm=mm-1;

              //check for the valid range
             
              if(mm<0)
              {
                   //set mm to maximum

                   mm=59;

                   //decreament the hour by 1

                   hh=hh-1;

                   //check for the valid range

                   if(hh<0)
                        hh=23;
              }
          }
     }


void main()
{
     Time t;

     t.readTime();

     t.showTime();

     t.increament();

     t.showTime();

     t.decreament();

     t.showTime();

     getch();

}

Question of glass and object

/*
     Question : Define a class Number , which contains the data member num and
          functions ,
              * read the number
              * display the number
              * reverse the number
              * check whether the number is palindrome or not
              * check whether the number is armstrong or not

*/

#include<iostream.h>
#include<conio.h>
class Number
{
     int num;
     public:
          void readNum()
          {
cout<<endl<<"Enter the number :";
              cin>>num;
          }
          void showNum()
          {
cout<<endl<<"Number ="<<num;
          }
          int reverse();
          void palindrome();
          void armstrong();
};
int Number::reverse()
{
     int num2=num;
     int rev=0;
     while(num2!=0)
     {  
          rev=rev*10+num2%10;
          num2=num2/10;
     }
     return rev;
}
void Number::palindrome()
{
     int rev;

     rev=reverse();

     if(rev==num)
          cout<<endl<<"Palindrome";
     else
          cout<<endl<<"Not Palindrome";
}

void Number::armstrong( )
{
     int num2=num;

     int sum=0;

     int a;

     while(num2!=0)
     {
          a=(num2%10);
    
          sum=sum+a*a*a;

          num2=num2/10;
     }

     if(sum==num)
          cout<<endl<<"Armstrong";
     else
          cout<<endl<<"Not Armstrong";

}

void main()
{
     Number ob;
int num;
     ob.readNum();

     ob.showNum();
    num=ob.reverse();
cout<<”Reverse=”<<num;
     ob.palindrome();
     ob.armstrong();

     getch();

Tuesday 24 September 2013

Function overloading
It refers to using the same function  name to perform the varity of different function
The difference in the Function call is made on the Basis of the following methods:
(1) Number of arguement
(2) Type of arguement
(3) Sequence of arguement
consider the following program:
 #include <iostream.h>
#include <conio.h>
void area( int side)
{
cout<<"Area of Square "<<side*side;
}
void area ( int length,int width)
{
cout<<length*width;
}
void area ( double radius)
{
cout <<3.14*radius*radius;
}
void main()
{
area(5,6);
area(8);
area (5.6);
getch();

}

Thursday 19 September 2013

Macros :
Macros are symbolic constants and they are used for improving the readability.
The general syntax for defining the macro is ,
#define macroname macroexpansion

e.g.#define MAX 50
Now,     MAX  is a macro and where ever we write MAX  it will be considered equivalent to 50.
And also ,
MAX=60;
will results in an error, as MAX  is replaced by 50 , so the statement means ,
50=60;
as we cannot assign one constant into another so it will give an error .
Consider the following code ,
       #include<iostream.h>
       #include<conio.h>
       #define PI 3.14
       void main()
       {
              float radius,area,circum;

              clrscr();

              cout<<endl<<"Enter the radius of the circle :";
              cin>>radius;

              //calculate the area of the circle

              area=PI * radius * radius;

              // calculate the circumference of the circle

              circum  = 2 * PI  * radius ;

              cout<<endl<<"Area of circle :" << area;

              cout<<endl<<"Circumference of the circle :"<<circum;

              getch();


}

Wednesday 18 September 2013

SOFT ROBOT CHANGES COLOR

Researchers have developed a system — inspired by nature — that allows the soft robots to either camouflage themselves against a background, or to make bold color displays. Such a “dynamic coloration” system could one day have a host of uses, ranging from helping doctors plan complex surgeries to acting as a visual marker to help search crews following a disaster.

Just as with the soft robots, the “color layers” used in the camouflage start as molds created using 3-D printers. Silicone is then poured into the molds to create micro-channels, which are topped with another layer of silicone. The layers can be created as a separate sheet that sits atop the soft robots, or incorporated directly into their structure. Once created, researchers can pump colored liquids into the channels, causing the robot to mimic the colors and patterns of its environment.The system’s camouflage capabilities aren’t limited to visible colors though.
When we began working on soft robots, we were inspired by soft organisms, including octopi and squid,” Morin said. “One of the fascinating characteristics of these animals is their ability to control their appearance, and that inspired us to take this idea further and explore dynamic coloration. I think the important thing we’ve shown in this paper is that even when using simple systems — in this case we have simple, open-ended micro-channels — you can achieve a great deal in terms of your ability to camouflage an object, or to display where an object is.”

“One of the most interesting questions in science is, ‘Why do animals have the shape and color and capabilities that they do?’ ” said Whitesides. “Evolution might lead to a particular form, but why? One function of our work on robotics is to give us, and others interested in this kind of question, systems that we can use to test ideas. Here the question might be: ‘How does a small crawling organism most efficiently disguise (or advertise) itself in leaves?’ These robots are test-beds for ideas about form and color and movement.”

 HOW THEY CHANGE COLOR?

Just as with the soft robots, the “color layers” used in the camouflage start as molds created using 3-D printers. Silicone is then poured into the molds to create micro-channels, which are topped with another layer of silicone. The layers can be created as a separate sheet that sits atop the soft robots, or incorporated directly into their structure. Once created, researchers can pump colored liquids into the channels, causing the robot to mimic the colors and patterns of its environment.
The system’s camouflage capabilities aren’t limited to visible colors though.
By pumping heated or cooled liquids into the channels, researchers can camouflage the robots thermally (infrared color). Other tests described in the Science paper used fluorescent liquids that allowed the color layers to literally glow in the dark.
Just as animals use color change to communicate, there are envisions about robots using the system as a way to signal their position, both to other robots, and to the public. As an example, the possible use of the soft machines during search and rescue operations following a disaster. In dimly lit conditions a robot that stands out from its surroundings (or even glows in the dark) could be useful in leading rescue crews trying to locate survivors.

Going forward, researchers hope to explore more complex systems that use multiple color layers to achieve finer control over camouflage and display colors, as well as ways to create systems — using valves and other controls — that  
the robots to operate autonomously.

 Future Applications

For defense applications, ingenuity and efficiency are not enough—robotic systems must also be cost effective. This novel robot is a significant advance towards achieving all three goals.”
In the video above, a soft robot walks onto a bed of rocks and is filled with fluid to match the color of the rocks and break up the robot’s shape. The robot moves at a speed of approximately 40 meters per hour; absent the colored fluid, it can move at approximately 67 meters per hour.
Future research will focus on smoothing the movements; however, speed is less important than the robot’s flexibility. Soft robots are useful because they are resilient and can maneuver through very constrained spaces.
For this demonstration, the researchers used tethers to attach the control system and pump pressurized gases and liquids into  the robot. Tethered operation reduces the size and weight of such robots by leaving power sources and pumps off-board, but future prototypes could incorporate that
equipment in a self-contained system.
At a pumping rate of 2.25 milliliters per minute, color change in the robot required 30 seconds. Once filled, the color layers require no power to sustain the color.
Aside from their potential tactical value, soft robots with microfluidic channels could also have medical applications. The devices could simulate fluid vessels and muscle motion for realistic modeling or training, and may be used in prosthetic technology.
The system might one day have applications ranging from helping doctors plan complex surgeries to acting as a visual marker to help search crews following a disaster

Tuesday 17 September 2013

pointer

Q.Write a "C" Program using function to swap to number

#include<stdio.h>
#include<conio.h>
/* function prototype */

void swap(int* ,int*);

void main()
{
     int a,b;

     clrscr();

       printf("\nEnter the value of a and b:");
     scanf("%d %d",&a,&b);

     printf("\nBefore Swap , a = %d , b=%d",a,b);

     swap(&a,&b); /*function call */

     printf("\nAfter Swap , a = %d , b=%d",a,b);

     getch();
}

/*function definition */

void swap(int *a,int *b)
{
     int c;

     c=*a;
     *a=*b;
     *b=c;


}
    
Find the output of the following program :

(i)
     #include<stdio.h>    
     #include<conio.h>
     main()
     {
          int i=4,j=5;

          junk(i,&j);

          printf("\n %d %d",i,j);
     }
     junk(int i,int *j)
     {
          i=i*i;

          *j=*j**j;
     }


i=4
j=25




             
#include<stdio.h>
#include<conio.h>
void main()
{
     int i=16;

     float f=3.14;

     char c='A';

     char *cc;

     cc=&c;

     printf("\n cc = %u  , *cc= %c",cc,*cc);

     cc=&i;

     printf("\n cc = %u  , *cc= %c",cc,*cc);

     cc=&f;

     printf("\n cc = %u  , *cc= %c",cc,*cc);

     getch();
}


####################################################################






Reference Variables :
The reference variable will store the reference of the variable. The general form of declaring the reference variable is ,
     datatype & referencevariablename=variablename;
e.g.
     int a=10;
     int &b=a;
     Now, b will be the reference variable and it will reference to a.
The reference variable is prefixed by an ampersand sign at the time of its declaration.     As , the pointer variable will store the address of the variable , the reference variable will store    the     refernce of the variable. That is , it will reference to the same location to which the variable    is referencing to.
     In case of pointers ,
          int a=10;
          int *b;
          b=&a;
                   

     In case of reference variable,
          int a=10;
          int &b=a;
              

          So , if we make any change in b , the change will get reflected in a and vice versa.
In c++, the reference variable can be used in three different ways ,

     (a) Independent Reference variable
     (b) Passing references to the functions
     (c) Returning references from the function.

     (a) Independent References Variables :
          Consider the following programs ,
     #include<iostream.h>
     #include<conio.h>
     void main()
     {
          int a=10;
          int &b=a;
cout<<endl<<"a= " << a <<" b="<<b;
          a=a+2;
          cout<<endl<<"a= " << a <<" b="<<b;
          b=b-1;
cout<<endl<<"a= " << a <<" b="<<b;
          int c=50;
          b=c;

cout<<endl<<"a= " << a <<" b="<<b<<"c="<<c;
          b=b+5;
          cout<<endl<<"a= " << a <<" b="<<b<<"c="<<c;
          getch();
}
output :
a=10 b=10
a=12 b=12
a=11 b=11
a=50 b=50 c=50
a=55 b=55 c=50
(b) Passing references to the function
Consider the following program ,

#include<iostream.h>
#include<conio.h>
/*function prototype*/
void swap(int & , int &);
void main()
{
     int a,b;

     clrscr();
cout<<endl<<"Enter the value of a and b:";
     cin>>a>>b;
cout<<endl<<"Before Swap a="<<a<<" b= "<<b;
swap(a,b); /*function call*/
cout<<endl<<"After Swap a="<<a<<" b="<<b;
getch();
}
/*function definition*/
void swap(int & x , int &y)
{
     int z;

     z=x;

     x=y;

     y=z;
}

Now , we have used the reference variables in the formal arguments ,so they will reference to the actual arguments , so the changes which we make in the formal arguments will also get reflected in the actual arguments.This is known as Call By Reference

(c) Returning References from the functions .

     Consider the following program ,

     #include<iosteam.h>
     #include<conio.h>
     /*fucntion prototypr*/

     char & func(int);

     /*global declaration */

          char s[ ] = "Hello World";

     void main()
     {
          func(5)='*'; /*function call*/

    
          cout<<endl<<s;
    
          getch();
     }

     /*function defintion */

     char & func(int pos)
     {

          return s[pos];
     }


output : Hello*World

Monday 16 September 2013


Q Find the output of the following programs :

          (i)
                             #include<stdio.h>
                             #include<conio.h>
                             void main()
                             {
                                      int a=5;

                                      int *b;

                                      b=&a;

printf("\nValue of a = %d" ,a);   ==>       Value of a = 5

printf("\nValue of a = %d" ,*(&a)); ==> Value of a = *(1000) ==> 5
printf("\nValue of a = "%d ,*b);   ==> Value of a = *b ==>*1000==>5

printf("\nAddress of a = %u" ,&a); ===> Address of a = 1000

printf("\nAddress of a = %u" ,b); ===> Address of a = 1000

printf("\nValue of b = %u" ,&a);===> Value of b = &a===> Address of a = 1000

printf("\nValue of b = %u" ,b); ===> Value of b = b===> Address of a = 1000


printf("\nAddress of b = %u",&b);===> Address of b =&b===> Address of b = 2000


          getch();

}

                             output :

                                



 (ii)

          #include<stdio.h>
          #include<conio.h>
                  
          void main()
          {
                   int a=5; /* Integer type variable */

                   int *b=&a; /* Pointer to an integer */              

                   int **c=&b; /* Pointer to a Pointer to an Integer */

                   int ***d=&c; /* Pointer to Pointer to Pointer to an Integer */



                   printf("\n%d%u%u%u",a,b,c,d);


                   printf("\n%d %d %d ",a+*b;*b+**c,*b+**c+***d);

                   getch();
}

output :



5 1000 2000 3000

a+*b ==>   5 + *(1000) ==> 5+5 = 10

*b+**c ==> *1000+ **2000 ==> 5 + *1000 ==> 5+5 = 10

*b+**c+***d===> *1000+**2000+***3000

                   5+*1000+**2000
                   5+5+*1000
                   5+5+5
                   15

(iii)

          #include<stdio.h>
          #include<conio.h>
          void main()
          {
                   int *p=4000;

                   printf("\n p=%u " , p);

                   p=p+1;

                   printf("\n p+1=%u",p);

          }

          %u is the format specifier used for printing the address . The address is always 16 bit and %d will point to 15 bit and they consider the one bit for storing the sign bit. And in case of %u, that is , unsigned all the 16   bits are used for storing the value.

          

          When ever we increament in the address , it will points to the next location  of that type.
          p=p+1=4000+1=4002

          As , each integer is of 2 bytes

(iv) main()
          {
                   char *c=4000;
                   int *i=4000;
                   float *f=4000;
                   double *d=4000;
                   long *l=4000;
                  
                   printf("\nc=%u , c+1=%u",c,c+1);
                   printf("\ni=%u , i+1=%u",i,i+1);
                   printf("\nf=%u , f+1=%u",f,f+1);
                   printf("\nd=%u , d+1=%u",d,d+1);
                   printf("\nl=%u , l+1=%u",l,l+1);
          }

===================================================
          Datatype                                          Size in Bytes
===================================================
          char                                                            1 byte
          int                                                               2 bytes
          float                                                  4 bytes
          double                                                       8 bytes
          long                                                  4 bytes
===================================================

So,the result is ,
          c=4000      , c+1=4001

          i=4000 , i+1= 4002

          f=4000 , f+1 = 4004

          d =4000 , d+1 = 4008


          l = 4000 , l+1=4004
How Touch-Screen work
While touch screens have become more prevalent in everyday electronics, few people understand how they really work. From the capacitive change from a human finger to the final motion on screen, the technical aspects of touch screens remain a mystery to most users. In fact, most users understanding of a touch screen consists of either “it works well” or “it doesn’t work well.” The question is how to understand the system well enough to determine what makes a touch screen work well or poorly. In order to understand this better, we would like to de-mystify how a touch screen registers the human touch, expose critical aspects of touch screen construction, and to show how touch motions on the touch screen are interpreted and result in screen action. 
What’s Inside the Touch Screen?
A capacitive touch screen is commonly constructed of several layers, called the “stackup.” The top layer is a protective layer composed of glass, or PMMA (commonly called Plexiglas or acrylic) with an anti-scratch coating. This layer is often shaped and printed with the company logo, button indicators, and is the outward most facing material of the phone or touch product.  Directly underneath this top layer is a thin layer of optically clear adhesive and then the exciting part—the touch-sensing layers.
The primary technical “secret” of the touch sensor layers is that they are constructed of indium-tin-oxide (ITO). The ITO is optically transparent, even though it is a ceramic. Typical capacitive ITO touch screens are ~92% transparent, which is a very large selling feature. Below the ITO sensing layers is an air gap or spacing that helps separate these touch sensing layers of ITO from the electrical noise of the bottom most layer—the LCD electronics. In Figure 1, there are two layers of ITO shown. Touchpanel vendors will use one, two, or even three layers of ITO depending on the specific product design considerations. Ultimately, however, the ITO layering is chosen depending on the touchpanel supplier’s technical capabilities as well as technical requirements from the customer. 

Figure 1: Cross-sectional view of capacitive touch screen “stackup”
If you examine a touch screen device from the right angle (with the LCD turned “off”), you may even be able to see the ITO pattern in the glass. Today, typical touch screens use a diamond pattern as shown in Figure 2. Diamonds have been chosen as a “best practice” for design because the ITO patterning must meet several requirements. First, the ITO layer must cover the whole screen, so that there is no visible variation in optical clarity. Second, it is easiest for system designers if the pattern corresponds to an X/Y grid—writing software that comprehends X and Y locations is simpler and more logical when making LCD update decisions. Finally, the pattern must provide continuity across the entire electrode. Diamonds with small bridges between them meet all of these needs. 

Figure 2: ITO patterning on a typical touch device provides X & Y touch information

The Physics of Touch
The key to making a capacitive touch screen work is that the system is designed to detect minute changes in capacitance introduced by a human finger. In fact, as a finger or other conductive object approaches the screen, it creates a parallel-plate capacitor between the sensors and the finger. This capacitor is small relative to the others in the system (about 0.5 pF out of 20 pF), but it is measurable with the right technology and filtering.  
A parallel-plate capacitor is composed of two conductive surfaces with an insulator between them. The ITO layer is a conductor, a user’s body is a conductor, and the glass or PMMA is an insulator. When a user touches the screen, they’ve become part of a capacitor. This same phenomenon is used in Cypress’s CapSense devices, which provide buttons and sliders in products from cell phones to washing machines.
One mechanism used to sense capacitance is Cypress’s CSD (CapSense with Sigma Delta). In this method, the capacitor is measured by a mechanism similar to a Sigma Delta ADC. The capacitor is connected to a bleed resistor (RBleed). If the voltage across the capacitor is above a threshold, a fixed charge is added to the cap. The circuit then measures the amount of time (counts) required to discharge the cap before the threshold is hit again. These counts are averaged over time to obtain an accurate capacitance measurement.
The CSD block diagram in Figure 3 appears complex at first, but it can be understood. Let’s start on the left hand side. The PRS (Pseudo-Random Source) causes Switch 1 (SW1) and Switch 2 (SW2) to alternate connections in a break-before-make pattern. This means that CSENSOR will be connected to VDD, then connected to CEXT over and over again. CEXT is an external capacitor used to integrate charge from CSENSOR. Every time CSENSOR is connected to VDD, it fills with charge. When CSENSOR is connected to CEXT , it charges CEXT. Note that CSENSOR is much smaller than CEXT. Imagine a bicycle pump and a tire. Each time SW1 is closed, the handle is pulled up and the air cylinder is filled. Every time SW2 is closed, the pump handle is pushed down and the air moves from the pump to the tire.

Figure 3: Capacitive charge circuit for sensing capacitive change and finger detection
The circuit elements in the middle portion of Figure 3 discharge CEXT and measure CSENSOR. When the voltage at CEXT is above VREF, SW3 is closed, which discharges CEXT. Think of this discharge as a safety valve on the bicycle tire. One important feature of this safety valve is that it discharges at a known rate.  Once we measure the discharge time, we know CSENSOR.

Figure 3: Capacitive charge circuit for sensing capacitive change and finger detection
The right-hand portion of the diagram is simply measuring the amount of time that SW3 is closed. The PWM provides a pause between scans to allow the processor to read samples. The counter measures time whenever SW3 is closed. As the capacitance increases at CSENSOR the charge sent to CEXT increases, so the amount of time that SW3 is closed must also increase.
It is this capacitive change that allows the touch screen controller to recognize that a touch (resulting in an increase in sensed capacitance) has occurred. The problem, of course, (and one of the key contributors to a “good” or “bad” touch screen), is the ability to tell a true finger touch from environmental noise. Noise in the system can really cause problems. If the touch controller is not able to distinguish an actual finger touch from just a capacitive noise spike, the touch screen will not react properly.
Finger Location Determination
Once the system can properly recognize a change in charge due to a finger touch, the exact location and motion path can be determined. Measuring the capacitance of all sensors in the touch screen produces information on exactly which sensors are active and the magnitude of capacitance change. Even though the screen may only contain an X/Y grid of 10x15 sensors, users want the system to report touch location accurately even within a millimeter. A simple interpolation technique can be used to determine finger position to a very fine degree. For example, if sensors 1, 2 and 3 see signals of 3, 10 and 7, the center of the finger is at (1*3+2*10+7*3) / (3+10+7) = 2.2. This value is normally scaled to match the pixel resolution of the LCD before it’s reported to the host CPU.
In a real design, there are several factors that complicate matters. When the finger reaches the edge of the panel, the interpolation breaks down because there is no “next sensor” to average into the computation. One method used to mitigate this effect is to assume that all finger touches produce the same total capacitance change. In the example used above, the finger created a capacitance change of 20 units. If a touch near the edge is measured with a capacitance change of only 15 units, it can be presumed that the remaining 5 units are over the edge.  
Additionally, customers may have unique industrial design requirements that dictate that a touch screen does not detect a touch when finger capacitance is witnessed on the touch screen edge (perhaps from holding the phone edges). In designs such as this, the touch screen controller must be flexible enough to be programmed to recognize these types of touches and to ignore them. 
Communication to the User
Now that a valid touch signal is present and the X/Y coordinates of the touch are known, it’s time to get the data to the host CPU for processing. Most touch screen devices communicate using the venerable I2C interface. The touch screen controller IC uses I2C (or SPI if desired) to pass X/Y or gesturing data to the product’s host processor where the command of product operation takes place. An example flow of this data transfer is shown in Figure 4.

Figure 4: Data processing flow from touch screen to host processor
In a real system, most of these touch detection and feedback operations take place in parallel because the touch screen is in constant detection mode when being operated by a user. As the touch data is collected, the touch controller device can either process the data to interpret a finger motion (or gesture) itself, or it can pass the raw data through a low-level driver to the host operating system for interpretation and action—and the rest is up to the user interface designers. Creating unique human interaction and exciting features that rely on touch will be an exciting place to watch for new development ideas in the near future. 
The fact that touch screens are becoming more and more popular is not a mystery. Consumers continue to call for cell phone, notebook, PC monitor, netbook, MP3 player and IP phone manufacturers to produce more versions of touch screen-based devices. With a more clear understanding of how capacitance change is sensed, how a finger location is determined and refined, and how the finger location data is passed up through the host system for operation, developers will be more able to supply innovative touch screen technology to meet the ever-increasing demand from users for this compelling interface.