unsigned char my_data;
void compare_data(void){
if (my_data == 1){
uart1_write_text("1");
delay_ms(200);
}
if (my_data == 0){
uart1_write_text("0");
delay_ms(200);
}
else
uart1_write_text("none");
delay_ms(200);
}
void main() {
adcon1 = 6;
cmcon = 7;
uart1_init(9600);
delay_ms(100);
while(1){
if (uart1_data_ready())
my_data = uart1_read();
compare_data();
}
}
Yeah it was supposed to echo it back. Anyway I got it working now CDRIVE I just changed the condition statements thank you for the help.I was able to unzip and view your VB files but I didn't see any obvious problems with it unless your Pic isn't sending text. I wasn't able to open your .DSN files because my Proteus is an ISIS version for Picaxe only. Please post all of your Pic code, or was that it in your last post?
Is your Pic supposed to echo back to VB (Text2.Text) the same data it received from Text1.Text?
Glad to hear it. BTW, just to satisfy my curiosity, where is the 'condition' statement? I didn't see it in your posted Pic code. But then...like I said, I don't know that language.Yeah it was supposed to echo it back. Anyway I got it working now CDRIVE I just changed the condition statements thank you for the help.
It was this oneGlad to hear it. BTW, just to satisfy my curiosity, where is the 'condition' statement? I didn't see it in your posted Pic code. But then...like I said, I don't know that language.
void compare_data(void){
if (my_data == 1){
uart1_write_text("1");
delay_ms(200);
}
if (my_data == 0){
uart1_write_text("0");
delay_ms(200);
}
else
uart1_write_text("none");
delay_ms(200);
}