Probleme beim seriellen Lesen der Windows-APIC++

Programme in C++. Entwicklerforum
Anonymous
 Probleme beim seriellen Lesen der Windows-API

Post by Anonymous »

Ich arbeite an einem C++-Projekt, um einen Arduino und die Windows-API zu verwenden, um den Windows-Sound mit dem Dienstprogramm „soundvolumeview“ von NirSoft zu steuern. NirSoft ist großartig und dieser Teil ist sehr einfach, aber ich habe noch nie die Windows-API verwendet und bin ein bisschen verloren.
Arduino-Datei:
(zu Testzwecken verwende ich ein Potentiometer)
Ich versuche, alles durch Kommas getrennt zu halten.

Code: Select all

void setup() {
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
int A0Value = analogRead(A1);
int A1Value = analogRead(A1);
int A2Value = analogRead(A1);
int A3Value = analogRead(A1);
int A4Value = analogRead(A1);
int A5Value = analogRead(A1);

String message =  "A0," + String(A0Value) + ","
"A1," + String(A1Value) +","
"A2," + String(A2Value) +","
"A3," + String(A3Value) +","
"A4," + String(A4Value) +","
"A5," + String(A5Value) + "\n";
//print out the value you read in the Serial Monitor:
Serial.print(message);
delay(1);
}
C++-Quelle für den PC:

Code: Select all

//#include "serialCommunication.h"
#include 
#include 
#include 
#include 
#include 
#include 

int main(){
// Serial Port Initialization
HANDLE hComm;

hComm = CreateFileW(L"\\\\.\\COM6",                //port name
GENERIC_READ | GENERIC_WRITE, //Read/Write
0,                            // No Sharing
NULL,                         // No Security
OPEN_EXISTING,                // Open existing port only
0,                            // Non Overlapped I/O
NULL);                        // Null for Comm Devices

if (hComm == INVALID_HANDLE_VALUE) {
if (GetLastError() == ERROR_FILE_NOT_FOUND) {
std::cerr

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post
  • Probleme beim seriellen Lesen der Windows-API
    by Anonymous » » in C++
    0 Replies
    1 Views
    Last post by Anonymous
  • Probleme beim seriellen Lesen der Windows-API
    by Anonymous » » in C++
    0 Replies
    0 Views
    Last post by Anonymous
  • Lesen Sie den seriellen Port unter Windows
    by Anonymous » » in Php
    0 Replies
    14 Views
    Last post by Anonymous
  • PHP: versucht, Daten vom seriellen COM-Port zu lesen (Windows)
    by Anonymous » » in Php
    0 Replies
    12 Views
    Last post by Anonymous
  • Raspberry Pi 5 mit SHT20-Sensor (XY MD02) Probleme und Probleme beim Lesen von Daten mit Minimalmodbus
    by Anonymous » » in Python
    0 Replies
    46 Views
    Last post by Anonymous