아두이노
-
시리얼 함수아두이노 2016. 10. 3. 17:14
1.Serial.Write() -사용법: Serial.write(param), Serial.write(byte형 배열, 길이)-파라미터:byte형 데이터, byte형 배열, 예제 코드 void setup(){ /* add setup code here */Serial.begin(9600); } void loop(){ /* add main program code here */ const uint8_t temp[5] = { '1','2','3','4','5' };Serial.write(1);delay(500);Serial.write(49);delay(500);Serial.print(1);delay(500);Serial.write('a');delay(500);//Serial.write(temp, 5);//del..
-
아두이노+ esp8266+DTH11아두이노 2016. 9. 19. 21:59
esp8266을 구입하면 제일면저 firmware를 업그레이드 하자(0.9.9.x) es8266 AP명령어 AT+GMR //버전확인 AT+CWMODE? //작동 모드 확인 1:station 2:AP 3:both AT+CWMODE=3; //작동모드 설정 AT+CWLAP //AP목록 확인 AT+CWJAP="SID Name","PASSWORD" AT+CWJAP? //접속AP확인 AT+CIFSR //할당 받은 ip확인 멀티채널 접속을 DisableAT+CIPMUX=0AT+CIPSTART="TCP","184.106.153.149",80AT+CIPSEND=43GET /update?key=QMRY6Q????GN????&field1=0// /input/[publicKey]?private_key=[privateKey]&..
-
DHT11 온도 습도 센서아두이노 2016. 9. 18. 11:32
DHT 센서를 이용해서 온도와 습도를 체크 할 수 있다. 1.준비사항 DHT11(22) 센서 모듈/ DHT Library / Arduino UNO DHT Libray 다운로드: https://github.com/adafruit/DHT-sensor-library 2.PIN 연결 DHT11 Arduino UNO GND --------------- GND Data ----------------- DPIN 2 VCC ------------------ VCC 5V 3.사진 4.테스트 코드 // Example testing sketch for various DHT humidity/temperature sensors// Written by ladyada, public domain #include "DHT.h" #de..
-
아두이노와 블루투스를 이용한 온도 습도 데이터 수집아두이노 2016. 9. 17. 23:57
Arduino – making a simple BlueTooth data logger 블루투수 모듈-JY-MC(http://www.dx.com/p/jy-mcu-arduino-bluetooth-wireless-serial-port-module-104299#.V91TgyiLTIV) 1.vcc:3.6~6v ------VC 5 2.GND -----------GND 3.TXD -------------11(SoftSerial RX) 4.RXD -------------10(SoftSerial RX) 자료출처http://www.geothread.net/arduino-making-a-simple-bluetooth-data-logger/
-
프로그램1-시리얼 통신2아두이노 2016. 7. 4. 22:08
아두이노 1.0에서 새롭게 추가된 serialEvent함수 이용. serialEvent함수는 loop함수가 순환될때 마다 호출 된다. //SerialRecive Serial event const int ledPin =13;int blinkRate =0; void setup(){Serial.begin(9600); //9600으로 시리얼 포트 초기화pinMode(ledPin,OUTPUT);} void loop() {blink(); } void serialEvent(){ while(Serial.available()){ char ch = Serial.read();Serial.write(ch); if(isDigit(ch)) {blinkRate = (ch - '0');blinkRate = blinkRate*100;..
-
프로그램1-시리얼통신아두이노 2016. 7. 3. 21:57
주제: PC에서 전송한 숫자를 읽어서 13번 LED 블링크 시간을 조절한다. const int ledPin = 13; int blinkRate=0; void setup() { // put your setup code here, to run once: Serial.begin(9600); //Searial port resetpinMode(ledPin,OUTPUT);} void loop() { // put your main code here, to run repeatedly: if(Serial.available()) { char ch =Serial.read(); //시리얼 포트에서 데이터 읽음 if( isDigit(ch)) { blinkRate=(ch -'0'); blinkRate = blinkRate* 10..