Keystudio smart farm kit

can anyone give advice or assistance on how to install the servo and the libraries needed for this kit? I can't seem to import the library needed either.

Did the kit come with information?

After a ten seconds search...
All the information is here...

thanks; yes I've got good info on the codes for the projects, but the importing of the libary has me beat, and the instructions on that are not working or missing. appreciate you help anyway.

Show the instructions you have.

How to Install a Library ?
Here we will introduce the most simple way to add libraries.
Click Skerch > Include Library > Add .Zip Library...
Find files(.zip) you need to add as library and wait. “Library installed” will be displayed if library is
successfully added

Wow. Sorry about those instructions. I am not at a computer, so I will leave the instructions for someone else, or later I will be online. @runaway_pancake ? rup?

This page is rather verbose... but works.

cheers.

this is the code I have so far:

Servo myservo; // create servo object to control a servo
// 16 servo objects can be created on the ESP32

int pos = 0; // variable to store the servo position
// Recommended PWM GPIO pins on the ESP32 include 2,4,12-19,21-23,25-27,32-33
int servoPin = 26;

void setup() {
Serial.begin(9600);
myservo.attach(servoPin); // attaches the servo on pin 26 to the servo object
myservo.write(180);
delay(2000);
}

void loop() {

for (pos = 80; pos <= 179; pos += 1) { // goes from 0 degrees to 80 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 81; pos -= 1) { // goes from 80 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

You missed the #include <Servo.h> at the top.

Please, format your code and paste it into a < CODE > block, or copy these three linse and paste your code in the middle line...

```
Paste code here
```

Paste code here
```**strong text**

#include <ESP32_Servo.h> //Import the library of servo
Servo myservo; // create servo object to control a servo
// 16 servo objects can be created on the ESP32

int pos = 0; // variable to store the servo position
// Recommended PWM GPIO pins on the ESP32 include 2,4,12-19,21-23,25-27,32-33
int servoPin = 26;

void setup() {
Serial.begin(9600);
myservo.attach(servoPin); // attaches the servo on pin 26 to the servo object
myservo.write(180);
delay(2000);
}

void loop() {

for (pos = 80; pos <= 179; pos += 1) { // goes from 0 degrees to 80 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 81; pos -= 1) { // goes from 80 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

Library Manager (IDE) is easiest way to add libraries.
Github is next easiest.

Hi @savagen - When you post program code, you should use the < CODE > button in your "message" box. That will bring up "code tags" that also say ```type or paste code here``` which means, "paste your code between the "tick marks" which look like this -> ``` and over the words that say type or paste code here The result should look like this:

#include <ESP32_Servo.h> //Import the library of servo
Servo myservo; // create servo object to control a servo
               // 16 servo objects can be created on the ESP32

int pos = 0; // variable to store the servo position

// Recommended PWM GPIO pins on the ESP32 include 2,4,12-19,21-23,25-27,32-33
int servoPin = 26;

void setup() {
  Serial.begin(9600);
  myservo.attach(servoPin); // attaches the servo on pin 26 to the servo object
  myservo.write(180);
  delay(2000);
}

void loop() {

  for (pos = 80; pos <= 179; pos += 1) { // goes from 80 degrees to 179 degrees in steps of 1 degree
    myservo.write(pos); // tell servo to go to position in variable 'pos'
    delay(15); // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos >= 81; pos -= 1) { // goes from 180 degrees to 81 degrees in setps of 1 degrees
    myservo.write(pos); // tell servo to go to position in variable 'pos'
    delay(15); // waits 15ms for the servo to reach the position
  }
}

The Keystone instructions are terrible. Sorry. But let's get this working.

You should have extracted a ZIP file for your programming environment. Did you get that done?

For the Servo library, can you find the Servo library ZIP file? If you can not find your Servo ZIP file, you can download it on this page by clicking the GREEN "CODE" dropdown and selecting "Download ZIP"

Next, in your IDE, go to IDE >> SKETCH >> INCLUDE LIBRARY >> ADD ZIP LIBRARY >> find the ZIP file you just downloaded.

Once that library is installed, you can compile your sketch and tell us what you see, good or bad.

If that library does not work (its GIT says "file is obsolete") then try this method:

In your IDE >> TOOLS >> MANAGE LIBRARIES >> enter ESP32SERVO and "install" ESP32Servo by Kevin Harrington. Try compiling your sketch again and tell us what you see, good or bad.

You will need to re-write the first line of your code to:

#include<ESP32Servo.h>

Here is the Keystone page of tutorials...
https://docs.keyestudio.com/projects/KS0567/en/latest/wiki/Arduino/arduino.html

Here is the Keystone page for software... (requires email/password to download files)
https://www.dropbox.com/scl/fo/2otxf5c6fjrhs0b5uxvqf/AH8Lsf37XpZrvhalk2lMF6A?rlkey=l9nfn1rvdwjj4ab7s5acupb8o&e=1&dl=0

I just learned that "scratch" is MIT App Inventor's name for their visual code, and not a typographical error.

Thank you so much! Im away from computer now but will try this.
Appreciate your assistance

I'm back! now where is that 'green' code button on this page? I've downloaded the servo file to the IDE and up to where you've asked me to find the zip file.

I tried to use my zip from the download. It downloaded but then got this message: Missing FQBN (Fully Qualified Board Name)

Compilation error: Missing FQBN (Fully Qualified Board Name)

and in the zip file I went to 'examples' and ' multiple servo example ESP-32 , and downloaded that. then it took me to the library download as per last message then select board, then that error message.

and I've installed the kevin harrington servo library ok

#include <ESP32Servo.h>
#include <analogWrite.h>
#include <tone.h>
#include <ESP32Tone.h>
#include <ESP32PWM.h>

#include <ESP32_Servo.h>  //Import the library of servo
Servo myservo;  // create servo object to control a servo
                // 16 servo objects can be created on the ESP32
                
int pos = 0;    // variable to store the servo position
// Recommended PWM GPIO pins on the ESP32 include 2,4,12-19,21-23,25-27,32-33 
int servoPin = 26;
                
void setup() {
  Serial.begin(9600);
  myservo.attach(servoPin);   // attaches the servo on pin 26 to the servo object
  myservo.write(180);
  delay(2000);
}

void loop() {

  for (pos = 80; pos <= 179; pos += 1) { // goes from 0 degrees to 80 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos >= 81; pos -= 1) { // goes from 80 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }

Also got this error downloading the servo code to the IDE from the project?
C:\Users\Nick Savage\Downloads\Arduino smart farm\2.Projects\CODDE_KS0567\6.1Servo\6.1Servo.ino:32:5: error: 'myservo' was not declared in this scope
32 | myservo.write(pos); // tell servo to go to position in variable 'pos'
| ^~~~~~~

exit status 1

Compilation error: 'Servo' does not name a type; did you mean 'Server'?