|
-
Aug 23rd, 2011, 09:04 AM
#1
Thread Starter
Member
c# serial
hi all vbforums,
[using Visual Studio 2008 Team System]
Nowadays I'm trying to communicate my Arduino with my C# program with using standart System.IO class. However despite I've added the serialPort object to my form, I couldn't succeed send and integer value with serialPort1.Write() method. I'm trying execute very simple code here's a little part of my program (you can see how it is easy)
Code:
serialPort1.Write(komut);
serialPort1.Write(data);
"komut" and "data" are my parameters, which is created by my function "veriGonder" (you can see the function below). And the methods that you can see @ above (serialPort1.Write methods) are in this veriGonder function.
Code:
private void veriGonder(string komut,string data)
{ do sth.. }
As I said, I'm just trying to send an integer (or byte is prefered) value but I couldn't send anything different than a string type (so, I've set the srialPort1 object settings correct, baudrate, stop bits etc..) And also I don't want to labour with lots of complex code stuffs.. (like in this web site)
I'll be happy if you can help.
Regards.
(P.S.: Can someone please show me how to flush this !hacking! serial buffer??)
Last edited by canavaroski90; Aug 23rd, 2011 at 09:08 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|