Danke für eure Unterstützung und entschuldigt, dass ich das nicht gleich gewusst habe. Am anderen PC hatte ich natürlich die Dateien noch nicht in "libraries" kopiert.
Soweit macht es nun den Anschein, dass die Ansteuerung (mit den min, max Werten muss ich noch etwas experimentieren) funktioniert.
Was ich noch nicht weiß, ist wie ich den Not Aus Schalter einbinden soll. Noch jemand einen Tipp für mich, wie ich meinen Code ergänzen muss?
Vielen Dank
Aktueller Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 20 chars and 4 line display
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.setCursor(3,0);
myservo.write(0); // <------ put the servo at zero
}
void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, -10, 160); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
lcd.setCursor(0,0);
lcd.print("Wuchtmaschine");
lcd.setCursor(0,1);
lcd.print("my name");
lcd.setCursor(0,2);
lcd.print("Balanceing Speed");
lcd.setCursor(0,3);
lcd.print("Prozent");
lcd.setCursor(13,3);
lcd.print("%");
lcd.setCursor(10,3);
lcd.print(" "); // This covers up the previous value
lcd.setCursor(9,3);
lcd.print(val);
delay(15); // waits for the servo to get there
}