Homeydurino and servo

Hey Guys!
I have succeded to blink an led with the flow card. but when i connect the servo PWM to where i have the led connected the servo does not move.

the servo is connected to 5+ and - and here i have a ground from the esp card allsow

any idea how to get the servo to work?

Maybe you can share some flows so other people can have a look at It and maybe can help you.
And maybe some pictures of youre build.

The problem is the code not the flow . it works to light a led but not to move a servo

You need to include and use a library for the servo, it generates a PWM signal (pulse width modulated) for the third wire of the servo. Have a look at Randomnerdtutorials.com for example scetches.
ESP32 Servo Motor Web Server with Arduino IDE | Random Nerd Tutorials

Can your power supply provide enough power for the servo? Also, since you’re using an ESP board, can your servo handle 3.3V I/O?

Yes it worked fine with an arduino uno but i have now seperet + - to the servo

Yes but i can´t seam to figure auto how to involve this in to homeys code

An Arduino Uno has a very different MCU and has 5V I/O, whereas the ESP’s have 3.3V I/O, hence the question if your servo accepts a 3.3V PWM signal.

I would suggest getting the servo-part working first (standalone), then the Homeyduino part.

Don’t understand what is the problem, is it the connections, or is it the code,
as Robert says, first make the conections and drive-code to the servo working and then the Homey-duino code.
Also you did not tell what ESP you are using.
If your code is not working, show your code.

@robertklep Yes i will try that. But do you think i need to drive it trough esp cardet?

@JPe4619 The card i use is Lilygo® Ttgo T-display. i will do as suggestet and try standalone code on de card too se if it moves the servo

edit: Standalone code is moving the servo.

Then i need help to get it moving when flow is active

You can start with the description from Athom, at:

And view this YouTube presentation:

then combine both into your sketch using:

 Homey.begin(hostName);
  Homey.setClass("windowcoverings");
  Homey.addCapability("windowcoverings_set", doServo); //"type": "range", "min": 0, "max": 1, "step": 0.01

  myServo.attach(8, 550, 2500); // 544-2400=def.?.. Attaches the servo on pin to the servo object

Also a very good instructor is RNT: ESP32 Servo Motor Web Server with Arduino IDE | Random Nerd Tutorials

thanks for good replays! :slight_smile: I am new to the coding scene and i thought it would be easyer. like i got a code working with digitalwrite and to turn on a led and thats with homeyduino code. and tought that it would work with the servo. like easy on off on the servo

Well, if you do understand all what you did with a LED and Homeyduino, this is just the next step, just cut and paste :+1:

Yee that i understand. but i can´t understand where to put it in the homeyduino code. i understand the arduino setup and loop but not where in homeyduino code.

You can P.M. me the source that you already have, we can try to find out what you need.