Notifications
Clear all
Topic starter
03/04/2023 10:42 am
Hi!
I just started a new project that shall control a servo. So I looked at this SHCustomProtocol topic and added some lines to SHCustomProtocol.h in order to perform some first tests. I uploaded the sketch to my Arduino Mini after applying the changes.
But it does not seem to work. I would expect to see a line like "Starting servo setup..." in Simhub's log but it does not appear. I can see lines like "[2023-04-03 10:30:04,852] INFO - Arduino debug message :Message received : 87;2" though, when I start a replay.
"C:\Program Files (x86)\SimHub\_Addons\Arduino\DisplayClientV2\SHCustomProtocol.h" now looks like:
#ifndef __SHCUSTOMPROTOCOL_H__ #define __SHCUSTOMPROTOCOL_H__ #include <Arduino.h> #include <Servo.h> class SHCustomProtocol { private: public: //Servo myservo; // create servo object to control a servo void setup() { FlowSerialDebugPrintLn("Starting servo setup..."); //myservo.attach(9); // attaches the servo on pin 9 to the servo object //myservo.write(0); FlowSerialDebugPrintLn("Servo attached and reset."); } void read() { String message = FlowSerialReadStringUntil('\n'); FlowSerialDebugPrintLn("Message received : " + message); int speed = FlowSerialReadStringUntil(';').toInt(); //myservo.write(speed); } void loop() { } void idle() { } }; #endif
What am I doing wrong?
Best regards
Donutz
23/02/2024 9:10 am
Have you found the error yet?
removed link
This post was modified 2 months ago 2 times by Iusodare