int const potPin = A1;
int const potPin1 = A0;
int potValue;
int potValue1;
int angle;
int angle1;
void setup () {
Serial.begin(9600);
}
void loop () {
potValue = analogRead(potPin);
potValue1 = analogRead(potPin1);
Serial.print("Potentiometer Value: ");
Serial.print(potValue);
Serial.print("Potentiometer Value1: ");
Serial.print(potValue1);
// potValue = constrain(potValue,0,1000);
angle= map(potValue, 0, 1023, 0, 179);
angle1= map(potValue1, 0, 1023, 0, 179);
Serial.print("\t \t Motor Angle: ");
Serial.println(angle);
Serial.print("\t \t Motor Angle1: ");
Serial.println(angle1);
delay(15);
}
硬體部分
硬體操作外觀
內部細節
沒有留言:
張貼留言