01-07 02:28
Recent Posts
Recent Comments
Tags
- ์จ์ผ๋ํ
- mysql
- ํ์ด์๊ณต๋ชจ์
- RaspberryPi
- ์๋์ด๋ ธ
- linux
- SQL
- API๋ง์ผํ๋ ์ด์ค
- Spring
- ict๊ณต๋ชจ์
- ํ์ด์ฌ
- ์คํฝ๋ ํ
- python
- ์กํ๊ณ
- API MarketPlace ๊ธ๋ก๋ฒ ์ํฌํฐ์ฆ
- appetizer
- ๋ฐ์ดํฐ๋ฒ ์ด์ค
- TSQL
- ํ์ด์
- Java
- ICT
- DB
- Naver Cloud
- ICT๋ฉํ ๋ง
- DATABASE
- ์๋ฐ
- JOBํ๊ณ
- ์คํฝ์ค๋น
- ์ด๋ธ์
- ํ๋ก๋ณด๋ ธ
- Today
- Total
miinsun
[์๋์ด๋ ธ] ์๋ณด ๋ชจํฐ ์ ์ด ๋ณธ๋ฌธ
๐ป ์ค์ต ํ๊ฒฝ
Board : Arduino UNO
Language : C
๐ฌ ์๊ตฌ ์ฌํญ
์๋ธ ๋ชจํฐ๋ฅผ ์ฐ๊ฒฐ
์๋ฆฌ์ผ ์ฐฝ์์ ํ์ ๊ฐ์ ์ ๋ ฅ ๋ฐ๊ธฐ
์ ๋ ฅ ๋ฐ์ ํ์ ๊ฐ์ผ๋ก ์๋ธ๋ชจํฐ๋ฅผ ํ์
- ํ๋ก๋ ๊ฐ์
์๋ธ๋ชจํฐ ๋ชจ๋ | Arduino UNO |
Brown Wire | GND |
Red Wire | 5V |
Orange Wire | 9 or Other PWN port |
๐ Code
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
Serial.begin(9600);
Serial.println("Servo motion version 2");
}
void loop() {
if(Serial.available()){
int input = Serial.parseInt();
if(Serial.read() == '\n'){
myservo.write(input);
Serial.print("Move to: ");
Serial.println(input);
}
}
}
'IoT > Arduino' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์๋์ด๋ ธ] ๋ธ๋ฃจํฌ์ค ํต์ (0) | 2021.12.03 |
---|---|
[์๋์ด๋ ธ] ์จ์ต๋ ์ผ์ ์ ์ด (0) | 2021.12.03 |
[Arduino] LCD ๋์คํ๋ ์ด ์ถ๋ ฅ (0) | 2021.12.03 |
[Arduino] LED ๋ฐ๊ธฐ ์กฐ์ (0) | 2021.12.03 |
Comments