나는 방금 Arduino를 시작했고 고급스런 것들에 대해 더 이상 생각하지 못했습니다. 그것은 매우 직설적 인 것처럼 보입니다. 이제 저는 보통 두 개의 장치를 통합하는 것을 좋아하는 사람입니다. 그래서 컴퓨터의 키보드로 서보를 제어 할 수 있는지 또는 Arduino 보드에 연결된 두 개의 하드웨어 푸시 버튼을 제어 할 수 있는지 궁금합니다.키보드 또는 다른 하드웨어 버튼으로 서보를 제어 하시겠습니까?
도움이 될 경우, 저는 Arduino Uno 보드를 사용하고 있습니다. 여기에 이제
지금
에 내가 서보을 청소하기 위해 사용하고있는 예제 코드, 이제 내 컴퓨터의 키보드에있는 왼쪽/오른쪽 화살표 키를 눌러를 통해 서보의 각도 변경을 원 가정 해 봅시다. 그 일에 대해 내가 어떻게 에 가겠습니까?// Sweep // by BARRAGAN <http://barraganstudio.com> // This example code is in the public domain. #include <Servo.h> Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created int pos = 0; // variable to store the servo position void setup() { myservo.attach(11); // attaches the servo on pin 9 to the servo object } void loop() { for(pos = 0; pos < 45; pos += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(10); // waits 15ms for the servo to reach the position } for(pos = 45; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(10); // waits 15ms for the servo to reach the position } }
달리, 난의 Arduino, 두 푸시 버튼 부착을 누르면 왼쪽 또는 오른쪽 버튼 을 따라 어느 서보 이동한다면 어떤. 어느 포트에 버튼을 연결합니까? 모든 코드 샘플 또는 다이어그램이 크게 도움이됩니다.
http://arduino.cc/en/Tutorial/Button 저 찾고 계신가요? 컴퓨터 키보드를 사용하는 경우 Arduino 또는 Arduino에 연결된 컴퓨터에 직접 연결되어 있습니까? – howardh
arduino는 컴퓨터에 연결되어 있습니다. 그리고 그 컴퓨터의 키보드에서 제어하려고합니다. 방정식에 하나의 컴퓨터 만. –