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.
int i;
i=8;
while (i)
{
GPIO.B0 = data>>1;
i--;
SClock=~SClock;
}
void shiftit( long value, int size)
{
while(size--)
GPIO.B0 = (value >>= 1) & 1;
}
Wouldn't the (value >>= 1) be evaluated first, thereby loosing the first bit? (and adding a trailing '0')GPIO.B0 = (value >>= 1) & 1;
#define SClock GPIO.B1
unsigned char Sdata;
unsigned char i;
void main() {
OSCCON = 0x72;
TRISIO = 0b00000000;
CMCON0 = 7; // no comparator
ANSEL = 0x00;
do {
Sdata =0b01010001;
for(i=0;i<8;i++){ //for 0 to 7
SClock=0;
GPIO.B0 = Sdata&1; //send out bit zero
Sdata>>=1; //shift data right 1 bit
asm nop;
SClock=1; //doesn't this need to be 1 then 0
}
} while (1);
}
Yep I got the idea i could use data as a variable from your site MrRB.I it worked before but I'm using the 4.80 beta.
...