본문 바로가기

임베디드/Arduino30

아두이노 무선으로 코드 업로드 하기 (블루투스) https://kocoafab.cc/tutorial/view/701 2020. 11. 17.
아두이노 내부 풀업 저항 사용하기 (INPUT_PULLUP) https://wikidocs.net/30793 위키독스 온라인 책을 제작 공유하는 플랫폼 서비스 wikidocs.net 2020. 11. 15.
발열패드 COM-11288 적정 전압은 5V , 전류는 600mA Operating Voltage: 5V DC Operating Current: ~750mA (~6.5Ω) https://www.devicemart.co.kr/goods/view?no=1327010#goods_file 발열 패드 Heating Pad - 5x10cm [COM-11288] Polyester filament, Micro Metal Conductive Fiber / Voltage: 5V DC / Current: ~750mA (~6.5Ω) / 5 x 10 cm www.devicemart.co.kr 적정전압은 5v지만 12v까지 올렸을 때도 괜찮았음 2020. 10. 22.
미세먼지 센서 GP2Y1010AU0F https://blog.naver.com/darknisia/221222455928 [아두이노 중급] 19. 미세먼지센서(GP2Y1010AU0F, GPA2Y1014AU0F) 이번 포스트에는 조금 한 물 간 주제인 먼지센서에 대해서 써볼까 한다. 한 때 미세먼지가 엄청난 화두가 ... blog.naver.com https://devicemart.blogspot.com/2019/12/gp2y1010au0f.html [아두이노] GP2Y1010AU0F 미세먼지 센서 사용해보기 전기/전자부품, 로봇/기계부품, 코딩교육 국내 1위 쇼핑몰 디바이스마트 공식 블로그입니다. devicemart.blogspot.com /* Standalone Sketch to use with a Arduino UNO and a Sharp.. 2020. 10. 21.
dht22 1번핀: 3.3V 또는 5V 의 전압이 사용이 가능 2번핀(SDA)으로 신호를 전송합니다. 3번핀: 사용하지 않습니다. 4번핀: GND 정식명칭은 AM2302 입니다. 2020. 10. 21.
analogWrite() 함수 Description Writes an analog value (PWM wave) to a pin. Can be used to light a LED at varying brightnesses or drive a motor at various speeds. After a call to analogWrite(), the pin will generate a steady rectangular wave of the specified duty cycle until the next call to analogWrite() (or a call to digitalRead() or digitalWrite()) on the same pin. You do not need to call pinMode() to set the pi.. 2020. 9. 18.
RGB LED 랜덤함수 pinMode(2, OUTPUT); 아날로그에 연결 했을때는 핀모드 입력 해주나 안해주나 똑같이 동작한다 int BLUE = 11; int GREEN = 10; int RED = 9; int i; long randNumber; void setup() { //pinMode(BLUE, HIGH);//BLUE //pinMode(GREEN, HIGH);//GREEN //pinMode(RED, HIGH);//RED randomSeed(analogRead(0)); Serial.begin(9600); } void loop() { i = random(1,256); Serial.println(i); analogWrite(BLUE, i); i = random(1,256); Serial.println(i); analogWr.. 2020. 9. 18.
JMOD-BT-01 블루투스 모듈 / dht11 / MIT App Inventor https://appinventor.mit.edu/ MIT App Inventor | Explore MIT App Inventor File Path Updates Starting with Android 10 Android 10 changes how applications can store data. If you use the File component you will want to read this blog entry which discusses how MIT App Inventor is adapting to this change. More appinventor.mit.edu https://firebase.google.com/ Firebase Firebase는 고품질 앱을 빠르게 개발하고 비즈니스를 성장.. 2020. 9. 16.
blynk dht11 /************************************************************* Download latest Blynk library here: https://github.com/blynkkk/blynk-library/releases/latest Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. You can easily build graphic interfaces for all your projects by simply dragging and dropping widgets. Downloads, docs, tutorials:.. 2020. 9. 16.
esp8266 blynk #define BLYNK_PRINT Serial #include #include // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "YourAuthToken"; // Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "YourNetworkName"; char pass[] = "YourPassword"; void setup() { // Debug console Serial.begin(9600); Blynk.begin(auth, ssid, pass); // You can also spec.. 2020. 9. 16.
아두이노 복습..하는...날 . ........... if (serial.available()) #시리얼에 뭐라도 입력되면 if (Serial.available() > 0) 위의 두개 같은 것임 analog값 범위 0~1023 void setup() { pinMode(13, OUTPUT); Serial.begin(9600); } void loop(){ if(Serial.available()){ int input = Serial.read(); if (input == '1'){ digitalWrite(13,HIGH); Serial.println(input); #print 49 } else if (input == '0'){ digitalWrite(13,LOW); Serial.println(input); #print 48 (아스키코드) } } } Serial.pr.. 2020. 9. 15.
arduino pin map 2020. 9. 15.
CLCD16x2 #include //LCD 라이브러리를 추가 //LiquidCrystal lcd(RS, Enable, DB4, DB5, DB6, DB7); LiquidCrystal lcd(3, 4, 5, 7, 10, 13); void setup() { lcd.begin(16, 2); //16열 2행짜리 LCD를 사용하겠다. } void loop() { lcd.setCursor(5, 0); //커서를 (5, 0)으로 보내라 lcd.print("Hello!!"); //(5, 0)부터 Hello!!를 찍어라 } https://m.blog.naver.com/PostView.nhn?blogId=microfun&logNo=220665857658&proxyReferer=https:%2F%2Fwww.google.com%2F [아두이노.. 2020. 9. 10.
아침 저녁 커텐 servo 알람중지 led 온도 습도 dht LCD cds lcd없는코드 #include "DHT.h" #include //Servo 라이브러리를 추가 #define DHTPIN 8 #define DHTTYPE DHT11 #define BUTTON_PIN1 2 //인터럽트 #define BUZZER 6 DHT dht(DHTPIN, DHTTYPE); int ledRed = 11; int cds = A0; Servo servo; //Servo 클래스로 servo객체 생성 int angle = 0; //Servo 각도를 조절할 변수 angle const int buttonPin1 = 2; // 인터럽트 0 volatile long preTime = 0; volatile long curTime = 0; const int deBounce = 200; volatile in.. 2020. 9. 10.
I2C LCD (아이스퀘어 LCD) , CLCD 2X16 16핀 I2C LCD (아이스퀘어 LCD) CLCD 2X16 16핀 2020. 9. 10.
서보모터 #include //Servo 라이브러리를 추가 Servo servo; //Servo 클래스로 servo객체 생성 int value = 0; // 각도를 조절할 변수 value void setup() { servo.attach(7); //맴버함수인 attach : 핀 설정 Serial.begin(9600); //시리얼 모니터 사용 고고 } void loop() { if(Serial.available()) //시리얼 모니터에 데이터가 입력되면 { char in_data; // 입력된 데이터를 담을 변수 in_data in_data = Serial.read(); //시리얼모니터로 입력된 데이터 in_data로 저장 if(in_data == '1') //입력된 데이터가 1이라면 { value += 30; //.. 2020. 9. 9.
0909 신호등 동작 처리 선생님코드 #include #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif const int buttonPin1 = 2; // 인터럽트 0 고정 const int buttonPin2 = 3; // 인터럽트 1 고정 const int buttonPin3 = 4; const int ledRed = 11; const int ledYellow = 9; const int ledGreen = 10; volatile int errFlag = FALSE; volatile int timerCnt; volatile int timerCnt2; volatile long preTime = 0; volatile long curTime = 0; const int.. 2020. 9. 9.
신호등 동작 처리 200903_TrafficLights-1polling_2외부interrupt_3timer #define BUTTON_PIN1 2 #include const int buttonPin1 = 2; // 인터럽트 0 buttonInterrupt1 const int buttonPin2 = 3; // 인터럽트 1 const int buttonPin3 = 4; int LED_R = 11; int LED_Y = 9; int LED_G = 10; volatile long preTime = 0; volatile long curTime = 0; const int deBounce = 200; int buttonState; volatile int checkBtn; volatile int flag=0; volatile int output = HIGH; void setup() { Serial.begin(9600); a.. 2020. 9. 3.
타이머 인터럽트 Timer interrupt #include const int RED = 13; const int BLUE = 12; volatile int output = HIGH; void flash() { digitalWrite(BLUE, output); output = !output; } void setup() { pinMode(RED, OUTPUT); pinMode(BLUE, OUTPUT); MsTimer2::set(500, flash); // 500ms period MsTimer2::start(); } void loop() { digitalWrite(RED, HIGH); delay(2000); digitalWrite(RED, LOW); delay(2000); } 2020. 9. 3.
키입력인터럽트 + LED + buzzer 1button pushed : led red on + buzzer buzz once 2button pushed : led yellow on + buzzer buzz twice 3button pushed : led green on + buzzer buzz 3times /* * 키입력 인터럽트 Update 2019.08.30 by hack4ork * 풀다운 폴링 */ #define BUTTON_PIN1 2 const int buttonPin1 = 2; // 인터럽트 0 const int buttonPin2 = 3; // 인터럽트 1 const int buttonPin3 = 4; volatile char flag=0; volatile long preTime = 0; volatile long curTime = .. 2020. 9. 2.