Project using Pico W and FS90R servos

Hi, this is my first time on Arduino Forum, I would appreciate some help with a science project. I have a little code experience but not much with servos, and am using a Pico W. I have the latest (2.3.4) version of Arduino IDE, and am controlling two FS90R continuous rotations servos with the Pico. However, when plugged in, one motor moves unpredictably and the other motor either doesn't move at all or doesn't stop when it's supposed to. If I switch the motors, I have the same problem. I don't know if it's a code issue, power issue, or circuit issue. When I experiment with the code to find a working code, it is unable to upload (error code: exit status 1). I have looked at several post on the Arduino and Raspberry Pi forums, and have also looked through the Arduino Stack Exchange.
When I plug in my board, the board is recognized, but the port is not a COM/Serial port, it is a UF2_Board, which I cannot fix. I have tried all ports on my computer, rebooted the board multiple times, and detached all wires connecting to my board. I saw an article saying to restart Arduino IDE but I don't want to risk losing my code. I also don't know how to restart Arduino IDE.
The servo motor that doesn't move is not vibrating or making any noise, and the wires are all correctly placed and are not loose. When I use myservo.write(90), the servo doesn't stop, and when I use a separate piece of code for the same motor, myservo.write(89) works. However, it doesn't work when I use the code needed for the project.
Any help is appreciated, I didn't anticipate these problems at all so I'm very lost. The servos are new and so is the board and USB cable.

Code:

#include <Servo.h>

Servo myservo;
Servo meservo;

void setup() {
  myservo.attach(18);
  meservo.attach(19);

  //set stop point
  myservo.write(89); 
  meservo.write(89);
}

void loop() {
  //define myservo (18)
  myservo.write(90);
  delay(500);
  myservo.write(89);
  delay(5000);

  //define meservo (19)
  meservo.write(90);
  delay(500);
  meservo.write(89);
  delay(5000);
}

There is myservo and meservo because there are two servos.

Not sure why that would happen, just save the sketch. But I doubt a restart of the IDE will help. Was the Pico recognised properly before?

A diagram over your setup is needed as well as the code, in order for us to help you. You can preferably edit this into your first post, and remember to post code as code.

With that said, welcome to the Arduino forum!

Please post schematics showing every connection and powering. The alternative is bad, sending You guesses in volumes that will make You forever will investigate, research.....

1 Like

You restart the IDE the same way you initially started it.
You need to find the documentation re the PICO and understand the UF2 mode vs the 'normal' mode. Here is my magic sauce.

Here is an image of the schematic (it is hand drawn, and it's not very good, but I don't know what else to do) :
(image deleted) [image contents: hand-drawn schematic]
The Pico is powered by a USB cable plugged into a wall socket.

Thank you, I have searched it up.
(image deleted)
Does this mean that if I hold down BOOTSEL, it will go into UF2 mode? And what does it mean by UF2 file, I don't have any to copy, unless I'm supposed to turn the code into a UF2 file.

Even small servos like that have quite high stall current, for two of them about 1.5A. And they draw that briefly on start. How is your wall socket? Also, it's never recommended to power motors from dev board pins.

1 Like

If you read the docs, you would see UF2 is mass storage so the 'board' looks a lot like a USB drive. You can find various pre-compiled UF2 files for various tasks like installing microPython BUT the Arduino IDE does NOT create them, with the IDE you just work as with any other board. If there is some advantage, you can find procedures and tools to enable getting IDE code to the board via UF2. One reason is producing multiple identically flashed boards.

I think the wall socket is just a normal wall socket, can I power the motors from 3.3V? Also, the VBUS is connected to power on the breadboard, and the red wires are connected to power on the breadboard too, is that okay?

Just in case you didn't 'get' it, as @kmin said but I will say it stronger, DO NOT POWER MOTORS FROM LOGIC PINS!!! You will need a separate power supply to power the servos, BUT connect the grounds in common.

No.

Better than passing it through Pico. But breadboards are not ideal for high current either.
What's the amp rating of your PSU?

Edit
Or do you mean you power everything through Pico but just share the power on the breadboard? That's not good solution.

For the Pico itself the power supply has to be a minimum of 1.8 volts and a maximum of 5.5 volts, and all other projects I've done on a Pico work when I plug it into the wall.
If I can't power the motors from 3.3V, where would I get the power from? If I use batteries, how would I fit it into the project? I have no experience with batteries, I just know they can be used in projects as a power source.
Everything is on the breadboard, except for the pico which is plugged in and the motors, which are attached by wires.

You didn't answer for question about PSU amp rating.

From PSU, without passing through Pico. If the amp rating is high enough, you don't need separate power supplies, just split it for motors and pico.

The PSU is the power supply, right? The Pico is powered by the wall socket, which I don't know the amp rating of. I don't have that much code experience, and I don't know anything about our wall sockets other than the fact that they can power a Pico W and that it works. How would I find the amp rating?

It's written on the power supply. Like 2A or 800mA for example...

For a wall socket? Or is it on the Pico?

on your USB power supply.

I am using a 12W USB power adapter from Apple, it is model A1401 with input 100-240V, 0.5A, or 50-60Hz. It has output 5.2V or 2.4A.
(image deleted) [image contents: Apple power adapter]

Looks good.
While you should seriously consider what I wrote about passing motor power through Pico, I expect that you have some other problem as well.
Is that servo library compatible with Pico?
Did you try just with one servo on your code?

The code requires two servos, so I have two servos, I also have changed the servos out and experienced similar problems.