We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I need to assign the value of the speed slider to a variable and write that variable to the servo. Can you help me Here is my code:
import controlP5.*;
ControlP5 controlP5;
import processing.io.*;
SoftwareServo servo;
void setup() {
size(255,100);
controlP5 = new ControlP5(this);
controlP5.addSlider("Speed",0,180,0,10,10,200,30);
servo = new SoftwareServo(this);
servo.attach(4);
servo.write(left);
delay(200);
exit();
}
void draw(){
background(100);
}
Answers
Format your code. Edit your post, select your code and hit ctrl+o.
Here are two different ways to access a slider value, or more like how to establish the relationship btw them. I commented out code that was not relevant to my demo. I hope this helps,
Kf