congthegreat21
Newbie level 3
I have my research using C# program and interfaced with PIC16f877A using rs232. I can send data from my c# application to PIC but i don't know how to send back data from PIC to C# application.
(sample of C# code on the button SEND)
private void button1_Click(object sender, EventArgs e)
{
port.Open();
port.Write("b");
port.Close();
}
(sample of PIC code RECEIVE)
if (UART1_Data_Ready()) { // If data is received,
receive = UART1_Read(); // read the received data,
if(receive == 'b'){
LCD_Out(1,1,txt5);
floatToStr(amtpaid, txt);
LCD_Out(1,11,Ltrim(txt));
prevpulsecount=pulsecount;
prevpulsecount1=pulsecount1;
EEPROM_Write(0x80,prevpulsecount);
EEPROM_Write(0x90,prevpulsecount1);
}
else{
......}
I want to know how to send back data from PIC to C# and put it on the textbox of the C# application. PLEASE HELP ME!!!
(sample of C# code on the button SEND)
private void button1_Click(object sender, EventArgs e)
{
port.Open();
port.Write("b");
port.Close();
}
(sample of PIC code RECEIVE)
if (UART1_Data_Ready()) { // If data is received,
receive = UART1_Read(); // read the received data,
if(receive == 'b'){
LCD_Out(1,1,txt5);
floatToStr(amtpaid, txt);
LCD_Out(1,11,Ltrim(txt));
prevpulsecount=pulsecount;
prevpulsecount1=pulsecount1;
EEPROM_Write(0x80,prevpulsecount);
EEPROM_Write(0x90,prevpulsecount1);
}
else{
......}
I want to know how to send back data from PIC to C# and put it on the textbox of the C# application. PLEASE HELP ME!!!