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.
In your code this is wrong:
unsigned char *c;
That is just a pointer.. there is no memory reserved for characters.
will this will work??
char d[10];
char *c=d;
unsigned char HSerin()
{
if (RCIF) // Is there a character
return RCREG; // return character
else
return 255; // Or return -1
}
return 255; // Or return -1
what does this mean??
Nothing.. I think that was bad code from Ian. You can't return error codes in the same path you return data.. they need to be separated.
Yes you can if he uses ascii like I suggested a good while back.... This way he can learn software control..
Ritesh... If you use ascii like I showed you, you only need 0 to 127 ascii characters... So if the function returns 255 ( -1) then you know that a character isn't here yet!!!
I'm trying to simplify the serial transfer for Ritesh... Using binary data transfers wil be a tiny bit over his head... Be my guest if you can show him packet transfers.....
unsigned char b[10];
unsigned char *c="Hello";
for(char x=0;x<6;x++){
b[x]=HSerin();
}
int result = strncmp(c,b, compareLimit);
if(result > 0){
ch='a';
HSerout(ch);
}
else if(result < 0)
{
ch='b';
HSerout(ch);
}
else{
ch='c';
HSerout(ch);
}