serial-port

how to trim unknown first characters of string in code vision

青春壹個敷衍的年華 提交于 2020-02-23 06:56:05
问题 I set a mega16 (16bit AVR microcontroller) to receive data from the serial port which is connected to Bluetooth module HC-05 for attaining an acceptable number sent by my android app and an android application sends a number in the form of a string array whose maximum length is equal to 10 digits. The problem arrives while receiving data such that one or two unknown characters(?) exist at the beginning of the received string. I have to remove these unknown characters from the beginning of the

Serial programming in C , in DOS

心不动则不痛 提交于 2020-02-20 08:54:07
问题 I need to do some basic serial programming in C, in old 16-bits MS-DOS. I know the basics, i had coded some serial comm. in some microcontroller some decades ago, but that's now ancient knowledge, and it's not so easy to find information. I'm looking for some reliable (not necessarily free or open source) library or code, and general information. I'm also looking for some instructions/advise about how to test it, assuming I'm developing on a Win7 machine. For example, if it would be possible

Baud rate of inb and outb commands - linux

≡放荡痞女 提交于 2020-02-06 11:26:20
问题 I want to pass binary data from my PC to my micro-controller through the real serial port in my computer. At this time, I'm thinking of using INB and OUTB functions so I don't have to put up with linux tty character overrides. Question is, how do I configure the baud rate of the serial port, if I use its address with the INB and OUTB functions? For example, if I want to write to COM1 (0x3F8), how will I be able to determine the baud rate data is being written at? Does stty still have some

C# Errors with SerialPort WriteLine commands

青春壹個敷衍的年華 提交于 2020-02-06 08:09:27
问题 I am using the C# SerialPort class to write to my COM port. Weird thing is that I can get data from the port just fine - it sends data that I am expecting. However, I cannot send any data to the port. Any data that I send is immediately echoed back to me as new data coming from the port. I am expecting a "Done" command but it instead gives me back the data I just sent. It works just fine from Windows HyperTerminal but this code just won't work. I'm using 9600, 8-N-1 with no flow control. I'm

SerialPort Read Doesn't Work in C#

偶尔善良 提交于 2020-02-06 04:01:30
问题 i am develop C# windows app.it's read weight from weigh bridge machine to serial port.but,my code doesn't work.i am trying many examples download from internet doesn't work.my code is below: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO.Ports; using System.IO; namespace SerialPortTest { public partial class Form1 : Form { public Form1() {

SerialPort Read Doesn't Work in C#

匆匆过客 提交于 2020-02-06 04:01:24
问题 i am develop C# windows app.it's read weight from weigh bridge machine to serial port.but,my code doesn't work.i am trying many examples download from internet doesn't work.my code is below: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO.Ports; using System.IO; namespace SerialPortTest { public partial class Form1 : Form { public Form1() {

SerialPort Read Doesn't Work in C#

丶灬走出姿态 提交于 2020-02-06 04:01:12
问题 i am develop C# windows app.it's read weight from weigh bridge machine to serial port.but,my code doesn't work.i am trying many examples download from internet doesn't work.my code is below: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO.Ports; using System.IO; namespace SerialPortTest { public partial class Form1 : Form { public Form1() {

How to get event for different baudrate?

巧了我就是萌 提交于 2020-02-04 22:19:57
问题 I am working on native android application. In this application I am connecting hardware devices using usb cable, for this connection I used below library: https://github.com/felHR85/UsbSerial I have 3 different hardware devices and each device has different baudrate. I have one scan button in app. If user click on it then I need to check which device is connected and print its information. To implement this, I create 3 methods. Each method have same code with different baudrate. When user

How to get event for different baudrate?

人走茶凉 提交于 2020-02-04 22:18:32
问题 I am working on native android application. In this application I am connecting hardware devices using usb cable, for this connection I used below library: https://github.com/felHR85/UsbSerial I have 3 different hardware devices and each device has different baudrate. I have one scan button in app. If user click on it then I need to check which device is connected and print its information. To implement this, I create 3 methods. Each method have same code with different baudrate. When user

Trouble sending Data with QSerialPort

有些话、适合烂在心里 提交于 2020-02-04 09:30:26
问题 I am trying to write a QT application that can communicate with a propeller over USB. Reading through the documentation QSerialPort seems to be exactly what I need. For a simple test, I am trying to send the number "2" to my propeller project. The project itself has its own OLED screen that I can read results on. Here is the QT code itself: this->Serial=new QSerialPort(this); this->Serial->setPortName("/dev/ttyUSB0"); this->Serial->setBaudRate(QSerialPort::Baud9600); connect(this->Serial