Pages: 1 2 [3]   Go Down
Author Topic: cannot read the data from arduino to the c#  (Read 4699 times)
0 Members and 1 Guest are viewing this topic.
Indiana
Offline Offline
Jr. Member
**
Karma: 1
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

At a quick glance it looks ok to me, is it working?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it is not working for serial part..n the latlong transmitted cannot be displayed in the label in c# winform.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this is my snippet of coding for arduino..
Code:
float rate, waterlevel,longitude,latitude;
...if (latitude== 3.8463 && longitude==103.3059)
{serial.print("latitude:");
serial.println(latitude,4);
serial.print("longitude:");
serial.println(longitude,4);

why i cannot pun the value of latitude and longitude into the label on the winform?
Logged

Indiana
Offline Offline
Jr. Member
**
Karma: 1
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Without seeing your C# code or a more detailed description of the problem,  I cannot help you as I do not understand what the problem is.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
why i cannot pun the value of latitude and longitude into the label on the winform?
You can, if you do it right. Are you (properly) using separate threads for the serial and UI activities?

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are some examples on stackexchange and perhaps also on the arduino forum. That being said, I attached a small project with a multiline textbox that receives messages from the serial interface (as well as a dropdown to select and connect with the proper COM) It should be easily modifiable for your purposes.

* commsapp.7z (33.59 KB - downloaded 13 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how to seperate the the thread from UI, PaulS?sorry for asking as im new in c#...from the search in the tutorial, it seems that i have to use the backgroundworker code..how i use that in proper manner?

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've attached a C# application that communicates with the Arduino, using separate threads for the UI and the serial data handling.

It should give you some clues.

* CommunicateWithArduino.zip (53.99 KB - downloaded 21 times.)
Logged

Pages: 1 2 [3]   Go Up
Jump to: