Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The ar1020 can detect Penup,down,location,screen calibration,speed of pen moving and adjust pen sensitivity, and you only need to read it when its touched, ( no need to keep sampling it ).
unsigned char WriteSWSPI( unsigned char output)
{
char BitCount; // Bit counter
volatile char input=0;
BitCount = 8; // Do 8-bits
SW_SCK_PIN = 0;
SW_DOUT_PIN = 0; // Set the Dout pin according to
for(BitCount=0;BitCount<8;BitCount++)
{
input <<= 1;
SW_SCK_PIN = 1;
if(output&0x80)
SW_DOUT_PIN = 1;
else
SW_DOUT_PIN = 0;
if(SW_DIN_PIN == 1)
input|=1;
else
input&=0xFE;
SW_SCK_PIN = 0;
output <<= 1;
}
return(input); // Return the received data
}
unsigned char WriteSWSPI( unsigned char output)
{
char BitCount; // Bit counter
volatile unsigned char input=0;
SW_SCK_PIN = 0;
SW_DOUT_PIN = 0; // Set the Dout pin according to
for(BitCount=0;BitCount<8;BitCount++)
{
input <<= 1;
if(output&0x80)
SW_DOUT_PIN = 1;
else
SW_DOUT_PIN = 0;
SW_SCK_PIN = 1;
if(SW_DIN_PIN == 1)
input|=1;
SW_SCK_PIN = 0;
output <<= 1;
}
return(input); // Return the received data
}