# 智慧電子應用設計導論(1/3) Actuator

## Presentation on theme: "智慧電子應用設計導論(1/3) Actuator"— Presentation transcript:

Chin-Shiuh Shieh (謝欽旭) Department of Electronic Engineering National Kaohsiung University of Applied Sciences, Taiwan TA：范家禎、姜丞俞 Autumn, 2015 C.-S. Shieh, EC, KUAS, Taiwan

YwRobot Relay Module 2 Channel 5V/12V/24V 繼電器模塊

YwRobot 9110風扇模塊 Fan Motor 馬達正反轉可控制，效率高。可吹滅20cm外的打火機火焰。

DC Motor void setup() { pinMode(2,OUTPUT); } void loop() {

Stepper Motor 步進馬達 步進馬達可簡單實現正確的定位運轉。馬達利用脈波信號正確控制運轉角度、轉速，且穩定性佳。

Stepper Motor (cont) int sm_pos=128;int vr_data=128;int sm_ctl=0x01;
void setup() { for(int i=0;i<4;i++) { pinMode(2+i,OUTPUT);digitalWrite(2+i,LOW); } void loop() { vr_data=analogRead(A0)/4; if(vr_data<sm_pos) { sm_ctl*=2;if(sm_ctl>8)sm_ctl=1;sm_pos--;if(sm_pos<0)sm_pos=0; } else if(vr_data>sm_pos) { sm_ctl/=2;if(sm_ctl==0)sm_ctl=8;sm_pos++;if(sm_pos>255)sm_pos=255; digitalWrite(2+i,bitRead(sm_ctl,i)); delay(1);

Tower Pro SG90 Micro Servo

Servo Motor (cont) #include <Servo.h> Servo servo; int val;
void setup() { servo.attach(2); } void loop() val = analogRead(A0); val = map(val, 0, 1023, 0, 179); servo.write(val); delay(100);