Click here to Skip to main content
15,914,795 members
Home / Discussions / C#
   

C#

 
AnswerRe: how can i create a moveable object Pin
Gerry Schmitz29-Oct-22 7:05
mveGerry Schmitz29-Oct-22 7:05 
QuestionC++ Pin
Mathooanyane Khoeli28-Oct-22 10:06
Mathooanyane Khoeli28-Oct-22 10:06 
AnswerRe: C++ Pin
Dave Kreskowiak28-Oct-22 11:47
mveDave Kreskowiak28-Oct-22 11:47 
AnswerRe: C++ Pin
OriginalGriff28-Oct-22 18:49
mveOriginalGriff28-Oct-22 18:49 
QuestionC++ Pin
Mathooanyane Khoeli28-Oct-22 10:02
Mathooanyane Khoeli28-Oct-22 10:02 
AnswerRe: C++ Pin
Dave Kreskowiak28-Oct-22 11:46
mveDave Kreskowiak28-Oct-22 11:46 
AnswerRe: C++ Pin
OriginalGriff28-Oct-22 18:47
mveOriginalGriff28-Oct-22 18:47 
QuestionC# vs C++ process standard out redirection differences Pin
Member 1490333523-Oct-22 7:52
Member 1490333523-Oct-22 7:52 
AnswerRe: C# vs C++ process standard out redirection differences Pin
OriginalGriff23-Oct-22 8:16
mveOriginalGriff23-Oct-22 8:16 
QuestionLoading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie22-Oct-22 23:59
Ozzie Mozzie22-Oct-22 23:59 
AnswerRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 0:51
mveOriginalGriff23-Oct-22 0:51 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie23-Oct-22 1:19
Ozzie Mozzie23-Oct-22 1:19 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 1:46
mveOriginalGriff23-Oct-22 1:46 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie23-Oct-22 2:05
Ozzie Mozzie23-Oct-22 2:05 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 2:37
mveOriginalGriff23-Oct-22 2:37 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie23-Oct-22 14:36
Ozzie Mozzie23-Oct-22 14:36 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie23-Oct-22 16:03
Ozzie Mozzie23-Oct-22 16:03 
GeneralRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 21:35
mveOriginalGriff23-Oct-22 21:35 
QuestionC# Save DataGrid Only MultiSelected Rows to File Pin
CodaNV22-Oct-22 17:03
CodaNV22-Oct-22 17:03 
AnswerRe: C# Save DataGrid Only MultiSelected Rows to File Pin
Dave Kreskowiak22-Oct-22 17:50
mveDave Kreskowiak22-Oct-22 17:50 
GeneralRe: C# Save DataGrid Only MultiSelected Rows to File Pin
CodaNV22-Oct-22 18:11
CodaNV22-Oct-22 18:11 
GeneralRe: C# Save DataGrid Only MultiSelected Rows to File Pin
Dave Kreskowiak22-Oct-22 18:24
mveDave Kreskowiak22-Oct-22 18:24 
GeneralRe: C# Save DataGrid Only MultiSelected Rows to File Pin
CodaNV22-Oct-22 18:47
CodaNV22-Oct-22 18:47 
QuestionArduino canot control computer. Pin
Member 1549382322-Oct-22 10:38
Member 1549382322-Oct-22 10:38 
Hi, please help my. I am try 2 days to solve main problem. Arduino device send jb_ready and this IF function dont work:
if (jb_serial_read == "jb_ready")
           {
               MessageBox.Show("it work");
           }


What i am want:
I am want control computer with arduino device. Because arduino device helo peoples with musculary dystrofi control computer. For control computer need working IF function.

C# code:
using System;
using System.IO.Ports;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace kp71
{
    internal class Ai
    {
        private string jb_serial_read;
        private SerialPort Jb_serial;

        public void Start_comunication_with_jbhid()
        {
            Jb_serial = new SerialPort("COM3", 9600)
            {
                ReadTimeout = 1000,
                WriteTimeout = 1000,
                Encoding = Encoding.GetEncoding("iso-8859-1")
            };
            Jb_serial.DataReceived += Jb_serial_DataReceived;
            Jb_serial.Open();
        }
        public void Help_enable()
        {
           if (jb_serial_read == "ok")
            {
                MessageBox.Show("it work");
            }


        }

        private void Jb_serial_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            Task jb_hid = new Task(() =>
            {
                try
                {
                    SerialPort sp = (SerialPort)sender;
                    jb_serial_read = Jb_serial.ReadExisting();
                }
                catch (Exception Error)
                {
                }
            });
            jb_hid.Start();
        }
        private void Send_data(string jb_serial_write)
        {
            Jb_serial.WriteLine(jb_serial_write);
        }
    }
}

Arduino code:
#include <SoftwareSerial.h>
#include <EEPROM.h>
SoftwareSerial mySerial(10, 11);

// Global digital reserved posts
#define cts 6
#define Watter_pump 7
#define Food_pump 8
#define Alarm 9

// Global analog reserved posts
#define EMG A7;

// CMD
String Command;
String Value;
String cmd;

void setup() {
  // Setup digital pinmode
  pinMode(Alarm, OUTPUT);
  pinMode(Food_pump, OUTPUT);
  pinMode(Watter_pump, OUTPUT);
  pinMode(cts, INPUT);

  // Serial budrate setup
  Serial.begin(9600);
  mySerial.begin(9600);

  // Default start string for pc
  Serial.println("jbHID ready...");
}

void loop() {
  get_cmd();
  Serial.println("jb_ready");
  delay(900);
}

AnswerRe: Arduino canot control computer. Pin
OriginalGriff22-Oct-22 10:53
mveOriginalGriff22-Oct-22 10:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.