이 확장보드를 사용하기 위해서는 아두이노 PHPoC 라이브러리의 ExpansionDCMotor 클래스를 사용합니다.
ExpansionDCMotor 클래스의 사용 가능한 멤버함수는 다음과 같습니다.
| 멤버 함수 | 설명 |
|---|---|
| int getPID(void) | 제품 아이디 읽기 |
| char *getName(void) | 제품명 읽기 |
| ExpansionDCMotor(int sid, int port) | 모터 포트의 인스턴스 생성 |
| setPolarity(int pol) | PWM 극성 설정 |
| setDirection(int dir) | 모터의 회전 방향 설정 |
| setPeriod(long period) | PWM 주기 설정 |
| setWidth(long width) | 유효 시간(듀티 사이클) 설정 |
| setDecay(int decay) | 감쇠모드 설정 |
| setEncoderPolarity(int pol) | 엔코더 카운트 방향 설정 |
| setEncoderPosition(long pos) | 엔코더 카운터값 설정 |
| setEncoderPSR(int psr) | 엔코더 샘플링 카운트 설정 |
| getEncoderPosition(void) | 엔코더 카운터값 모니터링 |
| getEncoderPeriod(void) | 엔코더 출력 펄스 주기 모니터링 |
| setFilterFrequency(long freq) | 저역통과필터 컷오프 주파수 설정 |
| setFilterPNC(int pnc) | 저역통과필터 노이즈 카운터값 설정 |
| getFilterPNC(void) | 저역통과필터 노이즈 카운터값 모니터링 |