工具:
焊槍+焊錫
焊接夾具
螺絲刀
膠水
遙控器(發射器):
1 xNRF24L01+PA+LNA2.4G發射接收通信模塊
1 x24L01無線模塊轉接板
1 xArduinoNano板
1 x100nF100納法電容
2 x雙軸按鍵傳感器
2 x2檔搖臂開關
1 x7.4v460Mah鋰電池
1 x330R電阻
1 x10K電位器
2 x15P2.54mm單排排針插座
1 x54mmX20mmPCB板
1 x7-9V的電池或者1x6節五號電池盒跟電池
若干:PCB板、電線、螺絲
// 8 Channel Transmitter (No Trim) | 8 Kanal Verici (Trim Yok)// Input pin A5 #include #include #include const uint64_t pipeOut = 000322; // NOTE: The same as in the receiver 000322 | Al?c? kodundaki adres ile ayn? olmal? RF24 radio(9, 10); // select CE,CSN pin | CE ve CSN pinlerin se?imi struct Signal { byte throttle; byte pitch; byte roll; byte yaw; byte aux1; byte aux2; byte aux3; byte aux4; }; Signal data; void ResetData(){ data.throttle = 0; data.pitch = 127; data.roll = 127; data.yaw = 127; data.aux1 = 0; // Signal lost position | Sinyal kesildi?indeki pozisyon data.aux2 = 0; data.aux3 = 0; data.aux4 = 0;} void setup(){ //Configure the NRF24 module | NRF24 modül konfigürasyonu radio.begin(); radio.openWritingPipe(pipeOut); radio.setAutoAck(false); radio.setDataRate(RF24_250KBPS); // The lowest data rate value for more stable communication | Daha kararl? ileti?im i?in en dü?ük veri h?z?. radio.setPALevel(RF24_PA_MAX); // Output power is set for maximum | ??k?? gücü maksimum i?in ayarlan?yor. radio.stopListening(); // Start the radio comunication for Transmitter | Verici i?in sinyal ileti?imini ba?lat?r. ResetData(); } // Joystick center and its borders | Joystick merkez ve s?n?rlar? int Border_Map(int val, int lower, int middle, int upper, bool reverse){ val = constrain(val, lower, upper); if ( val < middle ) val = map(val, lower, middle, 0, 128); else val = map(val, middle, upper, 128, 255); return ( reverse ? 255 - val : val );} void loop(){ // Control Stick Calibration for channels | Her bir kanal i?in kumanda Kol Kalibrasyonlar? data.roll = Border_Map( analogRead(A3), 0, 512, 1023, true ); // "true" or "false" for signal direction | "true" veya "false" sinyal y?nünü belirler data.pitch = Border_Map( analogRead(A2), 0, 512, 1023, true ); data.throttle = Border_Map( analogRead(A1),570, 800, 1023, false ); // For Single side ESC | Tek y?nlü ESC i?in // data.throttle = Border_Map( analogRead(A1),0, 512, 1023, false ); // For Bidirectional ESC | ?ift y?nlü ESC i?in data.yaw = Border_Map( analogRead(A0), 0, 512, 1023, true ); data.aux1 = Border_Map( analogRead(A4), 0, 512, 1023, true ); // "true" or "false" for change signal direction | "true" veya "false" sinyal y?nünü de?i?tirir. data.aux2 = Border_Map( analogRead(A5), 0, 512, 1023, true ); // "true" or "false" for change signal direction | "true" veya "false" sinyal y?nünü de?i?tirir. data.aux3 = digitalRead(7); data.aux4 = digitalRead(8); radio.write(&data, sizeof(Signal));}
// 8 Channel Transmitter & Trims | 8 Kanal Verici ve Trimler #include #include #include #include const uint64_t pipeOut = 000322; // NOTE: The same as in the receiver 000322 | Al?c? kodundaki adres ile ayn? olmal? RF24 radio(9, 10); // Select CE,CSN pin | CE ve CSN pinlerin se?imi #define trimbut_1 1 // Trim button 1 / Pin D1 #define trimbut_2 2 // Trim button 2 / Pin D2 #define trimbut_3 3 // Trim button 3 / Pin D3 #define trimbut_4 4 // Trim button 4 / Pin D4 #define trimbut_5 5 // Trim button 5 / Pin D5 #define trimbut_6 6 // Trim button 6 / Pin D6 int tvalue1 = EEPROM.read(1) * 4; // Reading trim values from Eprom | Trim de?erlerinin Epromdan okunmas? int tvalue2 = EEPROM.read(3) * 4; int tvalue3 = EEPROM.read(5) * 4; struct Signal { byte throttle; byte pitch; byte roll; byte yaw; byte aux1; byte aux2; byte aux3; byte aux4;}; Signal data; void ResetData(){ data.throttle = 512; // Signal lost position | Sinyal kesildi?indeki pozisyon data.pitch = 127; data.roll = 127; data.yaw = 127; data.aux1 = 0; data.aux2 = 0; data.aux3 = 0; data.aux4 = 0;} void setup(){ // Configure the NRF24 module | NRF24 modül konfigürasyonu radio.begin(); radio.openWritingPipe(pipeOut); radio.setAutoAck(false); radio.setDataRate(RF24_250KBPS); // The lowest data rate value for more stable communication | Daha kararl? ileti?im i?in en dü?ük veri h?z?. radio.setPALevel(RF24_PA_MAX); // Output power is set for maximum | ??k?? gücü maksimum i?in ayarlan?yor. radio.stopListening(); // Start the radio comunication for Transmitter | Verici i?in sinyal ileti?imini ba?lat?r. ResetData(); pinMode(trimbut_1, INPUT_PULLUP); pinMode(trimbut_2, INPUT_PULLUP); pinMode(trimbut_3, INPUT_PULLUP); pinMode(trimbut_4, INPUT_PULLUP); pinMode(trimbut_5, INPUT_PULLUP); pinMode(trimbut_6, INPUT_PULLUP); tvalue1= EEPROM.read(1) * 4; tvalue2= EEPROM.read(3) * 4; tvalue3= EEPROM.read(5) * 4;} // Joystick center and its borders | Joystick merkez ve s?n?rlar? int Border_Map(int val, int lower, int middle, int upper, bool reverse){ val = constrain(val, lower, upper); if ( val < middle ) val = map(val, lower, middle, 0, 128); else val = map(val, middle, upper, 128, 255); return ( reverse ? 255 - val : val );} void loop(){ // Trims and Limiting trim values | Trimler ve Trim de?erlerini s?n?rland?rma if(digitalRead(trimbut_1)==LOW and tvalue1 < 630) { tvalue1=tvalue1+15; EEPROM.write(1,tvalue1/4); delay (130); } if(digitalRead(trimbut_2)==LOW and tvalue1 > 280){ tvalue1=tvalue1-15; EEPROM.write(1,tvalue1/4); delay (130); } if(digitalRead(trimbut_3)==LOW and tvalue2 < 630) { tvalue2=tvalue2+15; EEPROM.write(3,tvalue2/4); delay (130); } if(digitalRead(trimbut_4)==LOW and tvalue2 > 280){ tvalue2=tvalue2-15; EEPROM.write(3,tvalue2/4); delay (130); } if(digitalRead(trimbut_5)==LOW and tvalue3 < 630) { tvalue3=tvalue3+15; EEPROM.write(5,tvalue3/4); delay (130); } if(digitalRead(trimbut_6)==LOW and tvalue3 > 280){ tvalue3=tvalue3-15; EEPROM.write(5,tvalue3/4); delay (130); } // Control Stick Calibration for channels | Her bir kanal i?in kumanda Kol Kalibrasyonlar? data.roll = Border_Map( analogRead(A3), 0, tvalue1, 1023, true ); // "true" or "false" for signal direction | "true" veya "false" sinyal y?nünü belirler data.pitch = Border_Map( analogRead(A2), 0, tvalue2, 1023, true ); data.throttle = Border_Map( analogRead(A1),570, 800, 1023, false ); // For Single side ESC | Tek y?nlü ESC i?in // data.throttle = Border_Map( analogRead(A1),0, 512, 1023, false ); // For Bidirectional ESC | ?ift y?nlü ESC i?in data.yaw = Border_Map( analogRead(A0), 0, tvalue3, 1023, true ); data.aux1 = Border_Map( analogRead(A4), 0, 512, 1023, true ); data.aux2 = Border_Map( analogRead(A5), 0, 512, 1023, true ); data.aux3 = digitalRead(7); data.aux4 = digitalRead(8); radio.write(&data, sizeof(Signal));}
控制電機(接收器):
1xNRF24L01+PA+LNA2.4G發射接收通信模塊
1x24L01無線模塊轉接板
1xArduinoNano板
1x100nF100納法電容
2x15P2.54mm單排排針插座
3x8P單排排針
1x54mmX20mmPCB板
1x7-9V的鋰電池
6x輕觸開關
若干:PCB板、電線
// 8 Channel Receiver | 8 Kanal Al?c? #include #include #include #include int ch_width_1 = 0;int ch_width_2 = 0;int ch_width_3 = 0;int ch_width_4 = 0;int ch_width_5 = 0;int ch_width_6 = 0;int ch_width_7 = 0;int ch_width_8 = 0; Servo ch1;Servo ch2;Servo ch3;Servo ch4;Servo ch5;Servo ch6;Servo ch7;Servo ch8; struct Signal { byte throttle;byte pitch;byte roll;byte yaw;byte aux1;byte aux2;byte aux3;byte aux4;}; Signal data; const uint64_t pipeIn = 000322;RF24 radio(9, 10); void ResetData(){ data.throttle = 0;data.roll = 127;data.pitch = 127;data.yaw = 127;data.aux1 = 0; // Define the inicial value of each data input. | Veri giri?lerinin ba?lang?? de?erleridata.aux2 = 0;data.aux3 = 0;data.aux4 = 0;} void setup(){ // Set the pins for each PWM signal | Her bir PWM sinyal i?in pinler belirleniyor. ch1.attach(0); ch2.attach(2); ch3.attach(3); ch4.attach(4); ch5.attach(5); ch6.attach(6); ch7.attach(7); ch8.attach(8); ResetData(); // Configure the NRF24 module | NRF24 Modül konfigürasyonu radio.begin(); radio.openReadingPipe(1,pipeIn); radio.setAutoAck(false); radio.setDataRate(RF24_250KBPS); // The lowest data rate value for more stable communication | Daha kararl? ileti?im i?in en dü?ük veri h?z?. radio.setPALevel(RF24_PA_MAX); // Output power is set for maximum | ??k?? gücü maksimum i?in ayarlan?yor. radio.startListening(); // Start the radio comunication for receiver | Al?c? i?in sinyal ileti?imini ba?lat?r. } unsigned long lastRecvTime = 0; void recvData(){while ( radio.available() ) {radio.read(&data, sizeof(Signal));lastRecvTime = millis(); // Receive the data | Data al?n?yor}} void loop(){recvData();unsigned long now = millis();if ( now - lastRecvTime > 1000 ) {ResetData(); // Signal lost.. Reset data | Sinyal kay?psa data resetleniyor} ch_width_1 = map(data.roll, 0, 255, 1000, 2000);ch_width_2 = map(data.pitch, 0, 255, 1000, 2000);ch_width_3 = map(data.throttle, 0, 255, 1000, 2000);ch_width_4 = map(data.yaw, 0, 255, 1000, 2000);ch_width_5 = map(data.aux1, 0, 255, 1000, 2000);ch_width_6 = map(data.aux2, 0, 255, 1000, 2000);ch_width_7 = map(data.aux3, 0, 1, 1000, 2000);ch_width_8 = map(data.aux4, 0, 1, 1000, 2000); ch1.writeMicroseconds(ch_width_1); // Write the PWM signal | PWM sinyaller ??k??lara g?nderiliyorch2.writeMicroseconds(ch_width_2);ch3.writeMicroseconds(ch_width_3);ch4.writeMicroseconds(ch_width_4);ch5.writeMicroseconds(ch_width_5);ch6.writeMicroseconds(ch_width_6);ch7.writeMicroseconds(ch_width_7);ch8.writeMicroseconds(ch_width_8); }
9V穩壓器:
1 x7809三級穩壓管
1 x1uF微法電容
1 x10uF微法電容
2 x100nf納法電容
若干:PCB板、電線
5V穩壓器:
1 x7805三級穩壓管
1 x1uF微法電容
1 x10uF微法電容
2 x100nf納法電容
若干:PCB板、電線
-
遙控器
+關注
關注
18文章
837瀏覽量
66125 -
DIY
+關注
關注
176文章
887瀏覽量
348617 -
nRF24L01
+關注
關注
17文章
330瀏覽量
69475 -
2.4GHz
+關注
關注
0文章
45瀏覽量
17890 -
Arduino
+關注
關注
188文章
6469瀏覽量
187070
發布評論請先 登錄
相關推薦
評論