나의 노력/아두이노(3)
-
PIEZO
#define PIEZO 3 void setup() { // put your setup code here, to run once: pinMode(PIEZO,OUTPUT); } void loop() { // put your main code here, to run repeatedly: tone(PIEZO,261); delay(1000); noTone(PIEZO); delay(1000); }
2019.09.19 -
스텝 모터
#include const int stepsPerRevolution = 200; Stepper myStepper(stepsPerRevolution, 11, 9, 10, 8); void setup() { myStepper.setSpeed(60); } void loop() { myStepper.step(stepsPerRevolution); delay(500); myStepper.step(-stepsPerRevolution); delay(500); }
2019.09.19 -
LCD 에 이름 띄우기
#include #include // (I2C 주소, 칸 수(X), 줄 수(Y)) LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { lcd.init(); lcd.backlight(); lcd.clear(); lcd.print("My Name Is"); lcd.setCursor(5,1); lcd.print("JangHyeYun"); delay(1000); lcd.clear(); lcd.print("My Name Is"); lcd.setCursor(5,1); lcd.print("Haley"); delay(1000); lcd.clear(); lcd.print("My Name Is"); lcd.setCursor(5,1); lcd.print("HIHIHI"); delay(..
2019.09.19