[SOLVED] how to send number to pic using c#

Status
Not open for further replies.

EgrK

Junior Member level 2
Joined
Jul 31, 2012
Messages
24
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
East part of world
Activity points
1,438
How to send number to pic 16f883 ,using c#

hellow members,guess what this is my 1st question
i am a c# programmer i could not send integer number to pic16f883
this is my method

Code:
privat void SendNo(int x)
{
Byte[] by=new Byte[10];
by[0]=x;//trying to send number  x=75
by[1]=0x0d;//cr
by[2]=0x0a;//lf
_serial.Write(by,0,3);
}

i did not think that there is any error in my pic file.asm,if you needed it, i will post part of it
just ask.
my problem i guess in the above code , any help?
 
Last edited by a moderator:

Re: How to send number to pic 16f883 ,using c#

Hellow members
i found the solution

Code:
//this how to call the method
Send2PicNumber(9);//assume you want to send number 9

//and this is the method
public static void Send2PicNumber(int Num)
        {
            Byte[] encodedBytes = new Byte[10];// ascii.GetBytes(str);
            encodedBytes[0] = (Byte)Num;
            _serial.Write(encodedBytes, 0, 1);
        }
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…