제조사 | OEM |
---|---|
브랜드 | 에듀이노 |
판매가 | 13,000원 |
적립금 | 130원 |
자체상품코드 | D-87 |
상품요약정보 | 180도 회전 MG996R |
국내·해외배송 | 국내배송 |
배송방법 | 택배 |
수량 |
COMMENT |
(최소주문수량 1개 이상 / 최대주문수량 0개 이하)
사이즈 가이드1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #include <Wire.h> #include <Adafruit_PWMServoDriver.h> #define nbPCAServo 16 int MIN_IMP [nbPCAServo] ={500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500}; int MAX_IMP [nbPCAServo] ={2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500}; int MIN_ANG [nbPCAServo] ={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int MAX_ANG [nbPCAServo] ={180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180}; Adafruit_PWMServoDriver pca= Adafruit_PWMServoDriver(0x40); void setup(){ Serial.begin(9600); Serial.println(F("Initialize System")); pca.begin(); pca.setPWMFreq(60); // Analog servos run at ~60 Hz updates } void loop(){ pcaScenario(); } void pcaScenario(){ for (int i=0; i<nbPCAServo; i++) { Serial.print("Servo"); Serial.println(i); for(int pos=(MAX_IMP[i]+MIN_IMP[i])/2;pos<MAX_IMP[i];pos+=10){ pca.writeMicroseconds(i,pos);delay(10); } for(int pos=MAX_IMP[i];pos>MIN_IMP[i];pos-=10){ pca.writeMicroseconds(i,pos);delay(10); } for(int pos=MIN_IMP[i];pos<(MAX_IMP[i]+MIN_IMP[i])/2;pos+=10){ pca.writeMicroseconds(i,pos);delay(10); } pca.setPin(i,0,true); } } int jointToImp(double x,int i){ int imp=(x - MIN_ANG[i]) * (MAX_IMP[i]-MIN_IMP[i]) / (MAX_ANG[i]-MIN_ANG[i]) + MIN_IMP[i]; imp=max(imp,MIN_IMP[i]); imp=min(imp,MAX_IMP[i]); return imp; } | cs |
상품에 대해 궁금한 점을 해결해 드립니다.
글읽기 권한이 없습니다.
"19세 미만의 미성년자"는 출입을 금합니다!
no | category | title | write | date | hit |
---|---|---|---|---|---|
37 | 모터 구동시 전원 [1] | 박재성 | 2024-05-25 | 2 | |
36 | 버튼을 누르지 않았는데 입력값대로 작동됩니다 [2] | CC&C | 2024-05-08 | 123 | |
35 | MSP 430 호환 [1] | 이도현 | 2023-09-23 | 187 | |
34 | HCPCA9685 라이브러리 파라미터 수정 관련 문의 [1] | 1805524872@k | 2023-05-19 | 421 | |
33 | MG966R 회전 각 해상도 문의 [2] | 1805524872@k | 2023-05-12 | 467 |