Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature currently requires accessing the site using the built-in Safari browser.
#define LED1 PORTBbits.RB0
#define LED1 PORTBbits.RB1
#define MASTER 1
#define SLAVE 0
static unsigned char mode
void setMode(unsigned char _mode)
{
mode = _mode;
}
void setRx(void)
{
if (mode == MASTER)
...
else
...
}
unsigned char *Port;
unsigned char *Tris;
unsigned char Mask;
void OwInit(unsigned char PortAdd,unsigned char Bit){
Port=(unsigned char *)(int)PortAdd;
Tris=Port+0x80;
Mask=1<<Bit;
*Port&=~Mask;
*Tris|=Mask;
}
unsigned char OwReset(){
bit temp;
*Tris&=~Mask; //pull line low
delay_10us(75);
*Tris|=Mask; //release line and make input
delay_us(68);
temp=((*Port&Mask)==0); //line pulled low if device present
delay_10us(48);
return temp; //return 0 if present
}