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.
unsigned char SL900A_Read(unsigned int uirMode, unsigned int uirAddress){
unsigned char ucResult;
SEN = 1;
delay_us(300);
uiTemp = uirAddress | uirMode;
SPI1_Write(uiTemp >> 8);
SPI1_Write(uirAddress & 0x00FF);
delay_us(300);
ucResult= SPI1_Read(0);
delay_ms(1);
SEN = 0;
return ucResult;
}
unsigned char ucKQ;
unsigned int uiAdd,i,uiMo,uirMo;
ucKQ = SL900A_Read(uirMo, 0x01F0);
while(1){
if(ucKQ == 0x01)
{
PORTB.B4 = 1;
}
else
{
PORTB.B4 = 1;
delay_ms(500);
PORTB.B4 = 0;
delay_ms(500);
}
}