IoT

    [아두이노] LCD 알파벳 표현하기

    /* LiquidCrystal Library - Hello World Demonstrates the use a 16x2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This sketch prints "Hello World!" to the LCD and shows the time. The circuit: * LCD RS pin to digital pin 12 * LCD Enable ..

    [아두이노] 키패드 입력받기

    #include const byte rows = 4; //four rows const byte cols = 4; //three columns char keys[rows][cols] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[rows] = {9, 8, 7, 6}; //connect to the row pinouts of the keypad byte colPins[cols] = {5, 4, 3, 2}; //connect to the column pinouts of the keypad Keypad customKeypad = Keypad( makeKeymap(keys), rowPins,..

    [아두이노] 아날로그 핀으로 모터움직이기(MAP함수)

    #include Servo myservo; // 서보모터 생성 int potpin = A0; //아날로그 핀 연결 int val; //핀 값 변수 void setup() { myservo.attach(9); Serial.begin(9600); } void loop() { val = analogRead(potpin); val = map(val, 0, 1023, 0, 180); myservo.write(val); Serial.println(val); delay(15); }

    [아두이노] IR리모컨을 이용한 LED RGB변경

    #include // 핀 선언 int red = 9; int green = 13; int blue = 10; int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { pinMode(red,OUTPUT); pinMode(green,OUTPUT); pinMode(blue,OUTPUT); Serial.begin(9600); irrecv.enableIRIn(); // start the receiver } void loop() { if(irrecv.decode(&results)){ Serial.println(results.value, HEX); irrecv.resume(); // receive the next value /..

    [아두이노] LCD 텍스트 출력

    /* LiquidCrystal Library - Hello World Demonstrates the use a 16x2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This sketch prints "Hello World!" to the LCD and shows the time. The circuit: * LCD RS pin to digital pin 12 * LCD Enable ..