이 프로젝트 정보
https://drive.google.com/open?id=1RNI2eaknWPN0lPpKm8wv95DUVcTr8H6
•인도의 농촌과 도시 모두에서 장애인 비율이 증가했습니다. 장애는 출생에 의해 또는 어떤 의학적 또는 우발적인 이유로 인해 발생할 수 있습니다.
•이 프로젝트의 목표는 손 제스처로 제어되는 휠체어를 만들고 가속도계를 센서로 사용하여 신체 장애인이 손의 지시를 받음으로써 한 장소에서 다른 장소로 이동할 수 있도록 돕는 것입니다.
•오늘날 인도에서는 많은 사람들이 장애로 고통받고 있으며, 하반신이 마비된 사람들이 있습니다. 이 휠체어는 편안함을 더하고 사람들의 삶을 조금 더 쉽게 만들어 줄 것입니다.
섹션> <섹션 클래스="섹션 컨테이너 섹션 축소 가능" id="코드"> 코드
<울> 송신기 코드
수신자 코드
송신기 코드Arduino
#include //nRF24L01+#include "RF24.h"와 통신하기 위한 SPI 라이브러리 //nRF24L01+#include "Wire.h"의 메인 라이브러리 //통신용#include "I2Cdev. h" //MPU6050과의 통신용#include "MPU6050.h" //MPU6050MPU6050의 메인 라이브러리 mpu;int16_t ax, ay, az;int16_t gx, gy, gz;int data[2];RF24 radio(9, 10); const uint64_t 파이프 =0xE8E8F0F0E1LL; 무효 설정(무효){ Serial.begin(9600); Wire.begin(); mpu.initialize(); //MPU 객체 초기화 radio.begin(); //nRF24 통신 시작 radio.openWritingPipe(pipe); //프로그램이 데이터를 보낼 수신자의 주소를 설정합니다.}void loop(void){ mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); 데이터[0] =map(ax, -17000, 17000, 300, 400); //X축 데이터 보내기 data[1] =map(ay, -17000, 17000, 100, 200); //Y축 데이터 보내기 radio.write(data, sizeof(data));}
수신기 코드Arduino
#include #include #include #include #include //nRF24L01+#include와 통신을 위한 SPI 라이브러리 " RF24.h" //nRF24L01의 메인 라이브러리+const int enbA =3;const int enbB =5;const int IN1 =2; //오른쪽 모터 (-) const int IN2 =4; //오른쪽 모터 (+) const int IN3 =7; //왼쪽 모터 (+) const int IN4 =6; //오른쪽 모터(-)int RightSpd =130;int LeftSpd =130;int data[2];RF24 radio(9,10);const uint64_t pipe =0xE8E8F0F0E1LL;void setup(){ //모터 핀을 OUTPUT으로 정의 핀모드(enbA, 출력); 핀모드(enbB, 출력); 핀모드(IN1, 출력); 핀모드(IN2, 출력); 핀모드(IN3, 출력); 핀모드(IN4, 출력); Serial.begin(9600); radio.begin(); radio.openReadingPipe(1, 파이프); radio.startListening(); } 무효 루프(){ if (radio.available()){ radio.read(data, sizeof(data)); if(data[0]> 380){ // 앞으로 analogWrite(enbA, RightSpd); analogWrite(enbB, LeftSpd); 디지털 쓰기(IN1, HIGH); 디지털 쓰기(IN2, LOW); 디지털 쓰기(IN3, HIGH); 디지털 쓰기(IN4, LOW); } if(data[0] <310){ //역방향 analogWrite(enbA, RightSpd); analogWrite(enbB, LeftSpd); 디지털 쓰기(IN1, LOW); 디지털 쓰기(IN2, HIGH); 디지털 쓰기(IN3, LOW); 디지털 쓰기(IN4, 높음); } if(data[1]> 180){ //왼쪽 analogWrite(enbA, RightSpd); analogWrite(enbB, LeftSpd); 디지털 쓰기(IN1, HIGH); 디지털 쓰기(IN2, LOW); 디지털 쓰기(IN3, LOW); 디지털 쓰기(IN4, 높음); } if(data[1] <110){ //오른쪽 analogWrite(enbA, RightSpd); analogWrite(enbB, LeftSpd); 디지털 쓰기(IN1, LOW); 디지털 쓰기(IN2, HIGH); 디지털 쓰기(IN3, HIGH); 디지털 쓰기(IN4, LOW); } if(data[0]> 330 &&data[0] <360 &&data[1]> 130 &&data[1] <160){ //자동차 정지 analogWrite(enbA, 0); analogWrite(enbB, 0); } }}
섹션>