Written by ZEDO 2016 1 1. MiniQ - 개요 DFRobot(http://www.dfrobot.com/) 에서 MiniQ 2WD 기반에 Romeo V2 All-in-one 컨트롤러 사용하여 사 용자가 다양한 컨스터마이징 작업을 수행할 수 있도록 제공함http://www.dfrobot.com/

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 8 Pulse Width Modulation (PWM)
Advertisements

EMS1EP Lecture 9 Analog to Digital Conversion (ADC) Dr. Robert Ross.
ARDUINO FRAMEWORK.
Intermediate Electronics and Lilypad Where Electronics Meet Textiles Workshop with Lynne Bruning and Troy Robert Nachtigall Sponsored by Spark Fun and.
Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Embedded Sumo 1T4 – 1T5 UTRA.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Introduction to Arduino Programming January MER-421:Mechatronic System Design.
Intro to Arduino with LilyPad Make a MakerSpace, Artisan’s Asylum Linz Craig, Chris Taylor, Mike Hord & Joel Bartlett.
Living with the Lab Using servos with an Arduino EAS 199A Fall 2011.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Basic Circuits – Lab 2 Arduino and Sensors
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi. Objectives 1. Control the rotation of standard servo motor  A standard servo motor is limited in its rotation.
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
ROBOTIC ARM 2 Wilmer Arellano © Hardware  Next slide shows sensor connection to analog pin 0 and Motor 1 connection. Lecture is licensed under.
Wireless TYWu. 433Mhz RF link kit Picture 433Mhz RF link kit Specification –Frequency: 433Mhz. –Receiver Data Output: High - 1/2 Vcc, Low - 0.7v –Transmitter.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Microcontroller basics Embedded systems for mortals.
Microcontroller basics Embedded systems for mortals.
ME 120: Arduino Programming Arduino Programming Part II ME 120 Mechanical and Materials Engineering Portland State University
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
INTERNET OF EVERYTHING SDU 2016 Week 12. Remotely Controlling Devices  interact with almost any device that uses some form of remote control  TVs, audio.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Istituto Tecnico Industriale A.Monaco EURLAB Moving a robot simple example program to control a DC-Motor Next - Press the button (left)
Capstone Design Middle Evaluation Rover Song Kee Hong Jo Kyeong Jin.
Introduction to Programming the Arduino Dr Gaw 3/21/14.
Electronic instrumentation Digitization of Analog Signal in TD
Pulse-Width Modulation: Simulating variable DC output
Ultrasonic Sensor TYWu.
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
Hacking on Arduino George Patterson
Raspberry Internet Rover Dipto Pratyaksa
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Manual for Arduino Kit v1.0
Microprocessors Tutorial 1: Arduino Basics
Microcontroller basics
European Robotic LABoratory
UCD ElecSoc Robotics Club 2017/2018
Arduino Part 1 Topics: Microcontrollers Programming Basics
Въведение в Arduino.
Arduino - Introduction
Chapter E –Transistors and H-Bridges
Control the color and brightness of an RGB LED with a Potentiometer
Arduino Uno and sensors
Control a motors angular position with a flex sensor
How to avoid catching things on fire.
Maxbotix Ultrasonic Distance Sensor
Arduino Analog I/O Analog input pins: 0 – 5
What is an Arduino ? Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Schedule 8:00-11:00 Workshop: Arduino Fundamentals
Ultrasonic Distance Sensor
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi.
Arduino : Introduction & Programming
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Model Blimp Design Competition Programming Workshop by Youth College (International) / VTC May
Arduino程式範例.
Pulse-Width Modulation: Simulating variable DC output
CTY SAR FCPS Alexander Velikanov
Presentation transcript:

Written by ZEDO MiniQ - 개요 DFRobot( 에서 MiniQ 2WD 기반에 Romeo V2 All-in-one 컨트롤러 사용하여 사 용자가 다양한 컨스터마이징 작업을 수행할 수 있도록 제공함 Sharp GP2Y0A21 Distance Sensor - operating voltage: 4.5 V to 5.5 V - average current consumption: 30 mA (typical) - distance measuring range: 10 cm to 80 cm (4" to 32") - output type: analog voltage - output voltage differential over distance range: 1.9 V (typical) - response time: 38 ± 10 ms Others No load - 50:1 Gear ratio V - 6V - 360mA stall 6V - 10 oz inches 6V

Written by ZEDO MiniQ - 연결도 A1 LEFT RIGHT DIO 4~6 는 모터 제어를 위해 사용함 A0 A2

Written by ZEDO MiniQ- 조립 방법 (1/3)

Written by ZEDO MiniQ- 조립 방법 (2/3)

Written by ZEDO MiniQ- 조립 방법 (3/3) 서버 모타의 방향을 반대로 설치 필요 ( 그렇게 하지 않을 경우 밧데리 홀더에 걸림 )

Written by ZEDO Code-IR Avoidance(1/3) /* # This Sample code is for testing the MiniQ Discovery Kit. # Editor : Phoebe # Date : # Ver : 0.1 # Product: MiniQ Discovery Kit # SKU : KIT0071 # Description: # Obstacle avoidance function of MiniQ Discovery Kit */ #include #include //Include Servo library Servo irservo; // create servo object to control a servo #define Svo_Pin 9 int posnow; int ir_sensor = A1; int S1 = 5; //D1 Speed Control( 왼쪽 ) int S2 = 6; //D2 Speed Control( 오른쪽 ) int D1 = 4; //D1 Direction Control( 왼쪽 ) int D2 = 7; //D1 Direction Control( 오른쪽 ) void stop(void) //Stop { digitalWrite(S1,0); digitalWrite(D1,LOW); digitalWrite(S2,0); digitalWrite(D2,LOW); } void advance(char a,char b) //Move forward { analogWrite (S1,a); //PWM Speed Control digitalWrite(D1,HIGH); analogWrite (S2,b); digitalWrite(D2,HIGH); } void back_off (char a,char b) //Move backward { analogWrite (S1,a); digitalWrite(D1,LOW); analogWrite (S2,b); digitalWrite(D2,LOW); } DFRobot 에서 제공하는 Sample 코드의 경우 모타 동작이 반대로 되어 수정 완료.

Written by ZEDO Code-IR Avoidance(2/3) void turn_L (char a,char b) //Turn Left( 왼쪽으로 빙빙 돌기 ) { analogWrite (S1,a); digitalWrite(D1,LOW); // 왼쪽 모터가 뒤로 돌기 analogWrite (S2,b); digitalWrite(D2,HIGH); // 오른쪽 모터가 앞으로 돌기 } void turn_R (char a,char b) //Turn Right( 오른쪽으로 빙빙 돌기 ) { analogWrite (S1,a); digitalWrite(D1,HIGH); // 왼쪽 모터가 앞으로로 돌기 analogWrite (S2,b); digitalWrite(D2,LOW); // 오른쪽 모터가 뒤로 돌기 } void setup() { int i; for(i=4;i<=7;i++) pinMode(i, OUTPUT); digitalWrite(S1,LOW); digitalWrite(S2,LOW); irservo.attach(Svo_Pin); //attaches the servo on pin 9 to the servo object Serial.begin(9600); //Set Baud Rate advance(80,80); } int pos=0; // variable to store the servo position float distance;

Written by ZEDO Code-IR Avoidance(3/3) void loop() { // digitalWrite(2,HIGH); for (int i=0;i<180;i++) { irservo.write(i); int x=analogRead(ir_sensor); // connect the GP2Y0A21 distance sensor to Analog A1 Serial.println(x); // print distance if(x>350) //13.7cm 보다 클 경우 (POWER(3027.4/x, )) { if(i<135) //43.5cm 보다 작을 경우 (POWER(3027.4/x, )) { back_off(80,80);delay(300); turn_L(80,80);delay(300); } else { back_off(80,80);delay(300); turn_R(80,80);delay(300); } advance(80,80); } delay(4); } for(int i=180;i>0;i--) { irservo.write(i); int x=analogRead(ir_sensor); Serial.println(x); // print distance if(x>350) //13.7cm 보다 클 경우 (POWER(3027.4/x, )) { if(i<135) //43.5cm 보다 작을 경우 (POWER(3027.4/x, )) { back_off(80,80);delay(300); turn_L(80,80);delay(300); } else { back_off(80,80);delay(300); turn_R(80,80);delay(300); } advance(80,80); } delay(4); }

Written by ZEDO Code-IR(GP2Y0A21) Distance /* Read values from Sharp GP2Y0A21 distance sensor and output to serial Sharp Distance Sensor GP2Y0A21 (10-80cm) 3.1V at 10cm to 0.3V at 80cm */ int ir_sensor = A1; void setup() { //initialize serial communications at 9600 bps Serial.begin(9600); } void loop() { int sensor_value = analogRead(ir_sensor); //read the sensor value Serial.println(sensor_value); //print the sensor vlue delay(500); //delay 500ms (0.5 second) }

Written by ZEDO Code-IR(GP2Y0A21) Distance with Average int ir_sensor = A1; // Analog A1 void setup() { Serial.begin(9600); } void loop() { Serial.println(value_average(10)); //loop 10 times and get its average delay(500); } int value_average(int average_count) { int sum = 0; for (int i=0; i<average_count; i++) { int sensor_value = analogRead(ir_sensor); sum = sum + sensor_value; } return(sum/average_count); } IR Sensor 에서 읽어 들이는 거리값에 대한 평균을 구하여 반영함 (Noise 고려 )

Written by ZEDO Code-IR(GP2Y0A21) Distance with Voltage int ir_sensor = A1; // Analog A1 void setup() { Serial.begin(9600); } void loop() { Serial.println(value_average(10)); //loop 10 times and get its average delay(500); } int value_average(int average_count) { int sum = 0; for (int i=0; i<average_count; i++) { int sensor_value = analogRead(ir_sensor); sum = sum + sensor_value; } return(sum/average_count); } IR Sensor 를 통해 전달되는 Analog 값은 10bit 해상도 (2^10=1024) 로 전달되며, 5V 에서는 1023, 2.5V 에서 는 512 값을 가짐 ( 센서에 가까울 수록 높은 값, 멀어질수록 낮음 값 )

Written by ZEDO Code-IR(GP2Y0A21) Distance(cm) int ir_sensor = A1; void setup() { //initialize serial communications at 9600 bps Serial.begin(9600); } void loop() { int sensor_value = analogRead(ir_sensor); //read the sensor value int distance_cm = pow(3027.4/sensor_value, ); //convert readings to distance(cm) Serial.println(distance_cm); //print the sensor value delay(500); //delay 500ms (0.5 second) } IR Sensor 를 통해 전달되는 값 (0(remote)~1023(near)) 을 meter 로 환산한다.

Written by ZEDO Code-IR(GP2Y0A21) Distance(cm) with Average int ir_sensor = A1; void setup() { //initialize serial communications at 9600 bps Serial.begin(9600); } void loop() { int distance = average_value(100); //loop 100 times and get its average Serial.println(distance); //print the sensor value delay(500); //delay 500ms (0.5 second) } int average_value(int average_count) { int sum = 0; for (int i=0; i<average_count; i++) { int sensor_value = analogRead(ir_sensor); //read the sensor value int distance_cm = pow(3027.4/sensor_value, ); //convert readings to distance(cm) sum = sum + distance_cm; } return(sum/average_count); } IR Sensor 를 통해 전달되는 값 (0(remote)~1023(near)) 을 meter 로 환산한다.( 평균값 고려 )

Written by ZEDO Code-Remeo V2 Button Control(1/2) char msgs[5][15] = { "Right Key OK ", "Up Key OK ", "Down Key OK ", "Left Key OK ", "Select Key OK" }; char start_msg[15] = { "Start loop "}; int adc_key_val[5] ={ 30, 150, 360, 535, 760 }; int NUM_KEYS = 5; int adc_key_in; int key=-1; int oldkey=-1; void setup() { // pinMode(13, OUTPUT); //we'll use the debug LED to output a heartbeat Serial.begin(9600); /* Print that we made it here */ Serial.println(start_msg); } DFRduino RoMeo 는 5 개의 버튼 (S1-S5) 이 있으며 하나의 Analog 입력 (0) 을 사용함 6 개의 Key 를 사용하기

Written by ZEDO Code-Remeo V2 Button Control(2/2) void loop() { adc_key_in = analogRead(0); // read the value from the sensor // digitalWrite(13, HIGH); /* get the key */ key = get_key(adc_key_in); // convert into key press if (key != oldkey) { // if keypress is detected delay(50); // wait for debounce time adc_key_in = analogRead(0); // read the value from the sensor key = get_key(adc_key_in); // convert into key press if (key != oldkey) { oldkey = key; if (key >=0){ Serial.println(adc_key_in, DEC); Serial.println(msgs[key]); } // digitalWrite(13, LOW); } // Convert ADC value to key number int get_key(unsigned int input) { int k; for (k = 0; k < NUM_KEYS; k++) { if (input < adc_key_val[k]) { return k; } if (k >= NUM_KEYS) k = -1; // No valid key pressed return k; } DFRduino RoMeo 는 5 개의 버튼 (S1-S5) 이 있으며 하나의 Analog 입력 (0) 을 사용함

Written by ZEDO Code-Remeo V2 Moter Control(1/2) //Standard PWM DC control int S1 = 5; //D1 Speed Control( 왼쪽 ) int S2 = 6; //D2 Speed Control( 오른쪽 ) int D1 = 4; //D1 Direction Control( 왼쪽 ) int D2 = 7; //D1 Direction Control( 오른쪽 ) void stop(void) //Stop { digitalWrite(S1,0); digitalWrite(D1,LOW); digitalWrite(S2,0); digitalWrite(D2,LOW); } void advance(char a,char b) //Move forward { analogWrite (S1,a); //PWM Speed Control digitalWrite(D1,HIGH); analogWrite (S2,b); digitalWrite(D2,HIGH); } Romeo V2 의 PWM 직렬 모터 제어는 2 개의 디지털 IO 핀 (4,6) 과 2 개의 PWM 핀 (5, 6) 으로 구성됨 1 번 모터 ( 오른쪽 ) 2 번 모터 ( 왼쪽 )

Written by ZEDO Code-Remeo V2 Moter Control(2/2) void back_off (char a,char b) //Move backward { analogWrite (S1,a); digitalWrite(D1,LOW); analogWrite (S2,b); digitalWrite(D2,LOW); } void turn_L (char a,char b) //Turn Left( 왼쪽으로 빙빙 돌기 ) { analogWrite (S1,a); digitalWrite(D1,LOW); // 왼쪽 모터가 뒤로 돌기 x analogWrite (S2,b); digitalWrite(D2,HIGH); // 오른쪽 모터가 앞으로 돌기 } void turn_R (char a,char b) //Turn Right( 오른쪽으로 빙빙 돌기 ) { analogWrite (S1,a); digitalWrite(D1,HIGH); // 왼쪽 모터가 앞으로로 돌기 analogWrite (S2,b); digitalWrite(D2,LOW); // 오른쪽 모터가 뒤로 돌기 } void setup(void) { int i; for(i=4;i<=7;i++) pinMode(i, OUTPUT); Serial.begin(9600); //Set Baud Rate Serial.println("Run keyboard control"); // 키보드로 제어하기 digitalWrite(S1,LOW); digitalWrite(S2,LOW); } Romeo V2 의 PWM 직렬 모터 제어는 2 개의 디지털 IO 핀 (4,6) 과 2 개의 PWM 핀 (5, 6) 으로 구성됨 void loop(void) { if(Serial.available()){ char val = Serial.read(); if(val != -1) { switch(val) { case 'w'://Move Forward Serial.println("Move Forward"); advance (40,40); //move forward in max speed break; case 's'://Move Backward Serial.println("Move Backward"); back_off (40,40); //move back in max speed break; case 'a'://Turn Left Serial.println("Turn Left"); turn_L (40,40); break; case 'd'://Turn Right Serial.println("Turn Right"); turn_R (40,40); break; case 'z': Serial.println("Hello"); break; case 'x': Serial.println("Stop"); stop(); break; } else stop(); }

Written by ZEDO Code- 적외선 원격 제어 ( 키값 읽기 ) 포토 트랜지스터를 Romeo V2 에 설치하여 리모콘에서 전달되는 값을 읽어 보자 포토 트랜지스터를 Romeo V2 의 아나로그 단자 (A2) 에 연결한다. - A1 은 거리 측정 센서 사용 // Photo Transistor example #include //IR 라이브러리 포함 int RECV_PIN = A2;// 포트선언 IRrecv irrecv(RECV_PIN); decode_results results;// 구조선언 void setup() { Serial.begin(9600); irrecv.enableIRIn(); } void loop() { if(irrecv.decode(&results)){ Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value }

Written by ZEDO Code- 적외선 원격 제어 ( 리모콘의 제조사 확인 ) 포토 트랜지스터에 신호를 전달하는 리모콘의 제조사와 키값을 확인하자. #include //IR 라이브러리 포함 int RECV_PIN = A2;// 포토 트랜지스터 포트 설정 long on1 = 0x00FF6897;// 수신된 신호 long off1 = 0x00ff30CF; long on2 = 0x00FF9867; long off2 = 0x00FF18E7; long on3 = 0x00FFB04F; long off3 = 0x00FF7A85; long on4 = 0x00FF10EF; long off4 = 0x00FF42BD; long on5 = 0x00FF38C7; long off5 = 0x00FF4AB5; long on6 = 0x00FF5AA5; long off6 = 0x00FF52AD; IRrecv irrecv(RECV_PIN); decode_results results;// 구조 선언 void dump(decode_results *results) { int count = results->rawlen; if (results->decode_type == UNKNOWN) { Serial.println("Could not decode message"); } else { if (results->decode_type == NEC) { Serial.print("Decoded NEC: "); } else if (results->decode_type == SONY) { Serial.print("Decoded SONY: "); } else if (results->decode_type == RC5) { Serial.print("Decoded RC5: "); } else if (results->decode_type == RC6) { Serial.print("Decoded RC6: "); } Serial.print(results->value, HEX); Serial.print(" ("); Serial.print(results->bits, DEC); Serial.println(" bits)"); } Serial.print("Raw ("); Serial.print(count, DEC); Serial.print("): "); for (int i = 0; i < count; i++) { if ((i % 2) == 1) { Serial.print(results->rawbuf[i]*USECPERTICK, DEC); } else { Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC); } Serial.print(" "); } Serial.println(""); } void setup() { pinMode(RECV_PIN, INPUT); // 포트모드,입력 Serial.begin(9600); // 전송속도 9600bps irrecv.enableIRIn(); // Start the receiver } int on = 0; unsigned long last = millis(); void loop() { if (irrecv.decode(&results)) // 디코딩 { // If it's been at least 1/4 second since the last // IR received, toggle the relay if (millis() - last > 250) { on = !on; digitalWrite(13, on ? HIGH : LOW); dump(&results); } if (results.value == on1 ) Serial.println ("on1"); if (results.value == off1 ) Serial.println("off1"); if (results.value == on2 ) Serial.println("on2"); if (results.value == off2 ) Serial.println("off2");; if (results.value == on3 ) Serial.println("on3"); if (results.value == off3 ) Serial.println("off3"); if (results.value == on4 ) Serial.println("on4"); if (results.value == off4 ) Serial.println("off4");; if (results.value == on5 ) Serial.println("on5"); if (results.value == off5 ) Serial.println("off5"); if (results.value == on6 ) Serial.println("on6"); if (results.value == off6 ) Serial.println("off6"); last = millis(); irrecv.resume(); // Receive the next value }

Written by ZEDO Code- 적외선 원격 제어 (MiniQ 제어 ) 적외선 원격 제어를 통해 MiniQ 를 구동해 보자 #include //IR 라이브러리 포함 int RECV_PIN = A2;// 포토 트랜지스터 포트 설정 long go = 0x00FF18E7;// 버튼 2 long back = 0x00FF4AB5;// 버튼 8 long left = 0x00FF10EF;// 버튼 4 long right = 0x00FF5AA5;// 버튼 6 long stop = 0x00FF38C7;// 버튼 5 IRrecv irrecv(RECV_PIN); decode_results results;// 구조 선언 unsigned long last = millis(); int S1 = 5; // Speed Control( 왼쪽 ) int S2 = 6; // Speed Control( 오른쪽 ) int D1 = 4; // Direction Control( 왼쪽 ) int D2 = 7; // Direction Control( 오른쪽 ) void brake(void) //Stop { analogWrite(S1,0); digitalWrite(D1,LOW); analogWrite(S2,0); digitalWrite(D2,LOW); } void advance(char a,char b) //Move forward { analogWrite (S1,a); //PWM Speed Control digitalWrite(D1,HIGH); analogWrite (S2,b); digitalWrite(D2,HIGH); } void back_off (char a,char b) //Move backward { analogWrite (S1,a); digitalWrite(D1,LOW); analogWrite (S2,b); digitalWrite(D2,LOW); } void turn_L (char a,char b) //Turn Left( 왼쪽으로 빙빙 돌기 ) { analogWrite (S1,a); digitalWrite(D1,LOW); // 왼쪽 모터가 뒤로 돌기 analogWrite (S2,b); digitalWrite(D2,HIGH); // 오른쪽 모터가 앞으로 돌기 } void turn_R (char a,char b) //Turn Right( 오른쪽으로 빙빙 돌기 ) { analogWrite (S1,a); digitalWrite(D1,HIGH); // 왼쪽 모터가 앞으로로 돌기 analogWrite (S2,b); digitalWrite(D2,LOW); // 오른쪽 모터가 뒤로 돌기 } void setup() { Serial.begin(9600); //Set Baud Rate for(int i=4;i<=7;i++) pinMode(i, OUTPUT); pinMode(RECV_PIN, INPUT); // 포트모드,입력 irrecv.enableIRIn(); // Start the receiver analogWrite(S1,0); analogWrite(S2,0); } void dump(decode_results *results) { if (results->decode_type == UNKNOWN) { //Serial.println("Could not decode message"); brake(); } void loop() { if (irrecv.decode(&results)) // 디코딩 { // If it's been at least 1/4 second since the last // IR received, toggle the relay if (millis() - last > 250) //1/4 초 이후 신호 수신의 경우 { dump(&results);// 적외선 신호 디코딩 } if (results.value == go ) advance(80,80); else if (results.value == back ) back_off(80,80); else if (results.value == left ) turn_L(80,80); else if (results.value == right ) turn_R(80,80); else if (results.value == stop ) brake(); last = millis(); irrecv.resume(); // Receive the next value }

Written by ZEDO 유첨. Romeo V2 - Arduino with Motor Driver 로미오 보드는 아두이노 우노와 같은 ATmega328 칩을 사용하며 2 개의 DC 모터 드라이버와 블루투스 소 켓이 내장되어 다양한 프로젝트에서 구현 가능함 MiniQ 에서 A0 에서 적외선 센서 미동작 사유는 S1~S5 사용을 On 했기 때문 (A0 사용 )

Written by ZEDO 유첨. Micro Metal Gear Motor with Connector (50:1)) MiniQ 에 장착된 DFRobot 사의 기어 비율 50:1 의 6V 메탈 기어드 모터 Operating Voltage: 1.0~6.0V Motor Speed: Gear Ratio: 50:1 Rated Current: Stall Current: Stall Torque: Weight: 15g