Forum: Mikrocontroller und Digitale Elektronik Arduino CmdMessenger3


von jdiephaus (Gast)


Lesenswert?

Hallo liebe Community,

ich beziehe mich in diesem Thread auf die CmdMessenger3 Library 
(https://playground.arduino.cc/Code/CmdMessenger3)

Es soll eine Float, welche auf Werten einer Sonde beruht, in einem 
bestimmten Delay an einen anderen Arduino gesendet und dort auf dem 
Display angezeigt werden.

Also einfach gesagt, Loop: Arduino 1 erstellt Float - sendet an Arduino 
2 - Arduino 2 stellt Float auf Display dar.

Wie ist dies mit CmdMessenger umzusetzen? Ich bekomm es einfach nicht 
auf die Kette. Würde mir jemand ein Minimalbeispiel geben können, damit 
ich das implementieren kann?

Vielen Dank im Vorraus!

Schöne Grüße,
jdiephaus (Arduino Noob)

von Anal Ysator (Gast)


Lesenswert?

Eigentlich genügt es ja die Anleitung zu lesen.

Hier ein essentieller Ausschnitt:

Start Zitat:
-----------------------------------------------
Sending a command

When sending a command without parameters, the format is

sendCmd (int cmdId)

When sending a command with an argument

sendCmd (int cmdId, T arg)
where T is the data type of the argument we want to send

If we want to send a command, and wait for a response, use:

bool sendCmd (int cmdId, T arg, bool reqAc, int ackCmdId, int timeout)

where

    reqAc determines whether we want to wait for a response (set to 
true)
    ackCmdId is the command to wait for and timeout is the timout in 
milliseconds.
    the return value is true if the response was received before 
timeout, else false.

Note that all commands other than the acknowledge command will be 
ignored (until time out)

-----------------------------------------------
Ende Zitat

jdiephaus schrieb:
> Würde mir jemand ein Minimalbeispiel geben können, damit
> ich das implementieren kann?

Ist das Suchen mit Schlüsselwörtern zu schwierig?

https://codebender.cc/example/CmdMessenger/SendAndReceiveArguments#SendAndReceiveArguments.ino

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.