91欧美超碰AV自拍|国产成年人性爱视频免费看|亚洲 日韩 欧美一厂二区入|人人看人人爽人人操aV|丝袜美腿视频一区二区在线看|人人操人人爽人人爱|婷婷五月天超碰|97色色欧美亚州A√|另类A√无码精品一级av|欧美特级日韩特级

電子發(fā)燒友App

硬聲App

掃碼添加小助手

加入工程師交流群

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>電子資料>高速Arduino遙控車開源分享

高速Arduino遙控車開源分享

2022-10-27 | zip | 0.26 MB | 次下載 | 2積分

資料介紹

描述

幾天前,我從童年時代發(fā)現(xiàn)了一輛漂亮的遙控車,但它的遙控器壞了,所以我想為什么不把這輛車改裝成高速 Arduino 遙控車。

所以現(xiàn)在就在這里,我已經(jīng)把它變成了一輛高速 Arduino 遙控車,今天我將與你分享我是如何做到的。我用于這個項目的應(yīng)用程序可以從這里下載。

高速 Arduino 遙控車的功能

這款高速 Arduino 遙控車的功能如下

  • 前燈
  • 背光燈
  • 中心的 RGB 燈會讓它看起來不錯
  • 喇叭
  • 全方位旋轉(zhuǎn)
  • 速度控制

所需組件

高速 Arduino 遙控車所需的組件如下

硬件

我使用了兩個 3.7V 的可充電電池來運(yùn)行這些電機(jī)。這些電池可以反復(fù)使用,也可以快速運(yùn)行電機(jī)。

如果您想了解更多關(guān)于 Arduino 與 RGB 模塊接口的信息,請閱讀本教程 | Arduino RGB LED 教程

如果您想了解更多關(guān)于藍(lán)牙模塊與 Arduino 接口的信息,請閱讀本教程 | Arduino藍(lán)牙模塊教程

?
pYYBAGNYsJOAJOBaAAFpxL6q8pY124.png
?

按照上面的電路圖完成所有連接后,我的汽車連接電路如下圖所示。

?
pYYBAGNYsJ6AAV8UABtfbPF59Aw063.jpg
?
?
pYYBAGNYsJ6AAV8UABtfbPF59Aw063.jpg
?

將頂部車身安裝在其上后,這輛車看起來就像一輛原始的蘭博基尼。中間連接的RGB讓它看起來更漂亮,它的高速使它可以與市場上的遙控車競爭。

?
poYBAGNYsLOAK8PTABf8mB3vSOw376.jpg
?
?
poYBAGNYsLyAIcrCABTKBQ2DkjQ033.jpg
?
?
poYBAGNYsMWAXML1ABPZTz5olmE776.jpg
?

代碼

//including the libraries
#include  // TX RX software library for bluetooth
#include 
//Defining pins for RGB led
#define GREEN 13
#define BLUE 5
#define RED 4
#define delayTime 3
#define LED_NUM 3
LEDFader leds[LED_NUM] = {
  LEDFader(4),
  LEDFader(5),
  LEDFader(13)
};
//Initializing pins for bluetooth Module
int bluetoothTx = 2; // bluetooth tx to 2 pin
int bluetoothRx = 3; // bluetooth rx to 3 pin
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
//Front Motor Pins  
int Enable1 = 6;
int Motor1_Pin1 = 7;  
int Motor1_Pin2 = 8;  
//Back Motor Pins      
int Motor2_Pin1 = 9; 
int Motor2_Pin2 = 10;
int Enable2 = 11; 
//Front Light pins   
int front_light1 = A0;
int front_light2 = A1;
//Back light pins
int back_light1 = A2;
int back_light2 = A3;
int horn = 12;
char command ; //variable to store the data
int velocity = 0; //Variable to control the speed of motor
void setup() 
{       
  //Set the baud rate of serial communication and bluetooth module at same rate.
  Serial.begin(9600);  
  bluetooth.begin(9600);
  //Setting the L298N, LED and RGB LED pins as output pins.
  pinMode(Motor1_Pin1, OUTPUT);  
  pinMode(Motor1_Pin2, OUTPUT);
  pinMode(Enable1, OUTPUT);
  pinMode(Motor2_Pin1, OUTPUT);  
  pinMode(Motor2_Pin2, OUTPUT);
  pinMode(Enable2, OUTPUT); 
  pinMode(front_light1, OUTPUT);  
  pinMode(back_light1, OUTPUT);
  pinMode(front_light2, OUTPUT);  
  pinMode(back_light2, OUTPUT);
  pinMode(horn, OUTPUT);
  pinMode(GREEN, OUTPUT);
  pinMode(BLUE, OUTPUT);
  pinMode(RED, OUTPUT);
  //Setting the enable and RGB LED pins as HIGH.
  digitalWrite(Enable1, HIGH);
  digitalWrite(Enable2, HIGH);
  digitalWrite(GREEN, HIGH);
  digitalWrite(BLUE, HIGH);
  digitalWrite(RED, HIGH);
}
void loop(){
  if(bluetooth.available() > 0){  //Checking if there is some data available or not
    command = bluetooth.read();   //Storing the data in the 'command' variable
    Serial.println(command);      //Printing it on the serial monitor
    
    //Change pin mode only if new command is different from previous.   
    switch(command){
    case 'F':  //Moving the Car Forward
      digitalWrite(Motor2_Pin2, LOW);
      digitalWrite(Motor2_Pin1, HIGH);
      digitalWrite(Motor1_Pin1, LOW);
      digitalWrite(Motor1_Pin2, LOW);
      break;
    case 'B':  //Moving the Car Backward
      digitalWrite(Motor2_Pin1, LOW);
      digitalWrite(Motor2_Pin2, HIGH);
      digitalWrite(Motor1_Pin1, LOW);
      digitalWrite(Motor1_Pin2, LOW);
      break;
    case 'L':  //Moving the Car Left
      digitalWrite(Motor1_Pin1, LOW);
      digitalWrite(Motor1_Pin2, HIGH);
      digitalWrite(Motor2_Pin1, LOW);
      digitalWrite(Motor2_Pin2, LOW);
      break;
    case 'R':   //Moving the Car Right
      digitalWrite(Motor1_Pin2, LOW);
      digitalWrite(Motor1_Pin1, HIGH);  
      digitalWrite(Motor2_Pin1, LOW);
      digitalWrite(Motor2_Pin2, LOW);
      break;
    case 'S':   //Stop
      digitalWrite(Motor2_Pin2, LOW);
      digitalWrite(Motor2_Pin1, LOW);
      digitalWrite(Motor1_Pin2, LOW);
      digitalWrite(Motor1_Pin1, LOW);
      break; 
    case 'I':  //Moving the Car Forward right
      digitalWrite(Motor2_Pin2, LOW);
      digitalWrite(Motor2_Pin1, HIGH);
      digitalWrite(Motor1_Pin2, LOW);
      digitalWrite(Motor1_Pin1, HIGH);
      break; 
    case 'J':  //Moving the Car backward right
      digitalWrite(Motor1_Pin2, LOW);
      digitalWrite(Motor1_Pin1, HIGH);
      digitalWrite(Motor2_Pin1, LOW);
      digitalWrite(Motor2_Pin2, HIGH);
      break;        
    case 'G':  //Moving the Car Forward left
      digitalWrite(Motor2_Pin2, LOW);
      digitalWrite(Motor2_Pin1, HIGH);
      digitalWrite(Motor1_Pin1, LOW);
      digitalWrite(Motor1_Pin2, HIGH);
      break; 
    case 'H':  //Moving the Car backward left
      digitalWrite(Motor2_Pin1, LOW);
      digitalWrite(Motor2_Pin2, HIGH);
      digitalWrite(Motor1_Pin1, LOW);
      digitalWrite(Motor1_Pin2, HIGH);
      break;
    case 'W':  //Front light ON 
      digitalWrite(front_light1, HIGH);
      digitalWrite(front_light2, HIGH);
      break;
    case 'w':  //Front light OFF
      digitalWrite(front_light1, LOW);
      digitalWrite(front_light2, LOW);
      break;
    case 'U':  //Back light ON 
      digitalWrite(back_light1, HIGH);
      digitalWrite(back_light2, HIGH);
      break;
    case 'u':  //Back light OFF 
      digitalWrite(back_light1, LOW);
      digitalWrite(back_light2, LOW);
      break; 
    case 'V':  //Horn On
      tone(horn,494);
      break; 
    case 'v':  //Horn OFF 
       noTone(horn);
      break;   
    case 'x': //Turn ON Everything
    break;
    case 'X': //Turn OFF Everything
      
    break;
    //Controlling the Speed of Car  
    default:  //Get velocity
      if(command=='q'){
        velocity = 255;  //Full velocity
        analogWrite(Enable2, velocity);
      }
      else{ 
        //Chars '0' - '9' have an integer equivalence of 48 - 57, accordingly.
        if((command >= 48) && (command <= 57)){ 
          //Subtracting 48 changes the range from 48-57 to 0-9.
          //Multiplying by 25 changes the range from 0-9 to 0-225.
          velocity = (command - 48)*25;       
          analogWrite(Enable2, velocity);
        }
      }
      }
    }
     RGB();
  } 
  void RGB()
{
    // Update all LEDs and start new fades if any are done
  for (byte i = 0; i < LED_NUM; i++) 
  {
    LEDFader *led = &leds[i];
    led->update();
    // This LED is not fading, start a new fade
    if (led->is_fading() == false) 
    {
      int duration = random(1000, 3000); // between 1 - 3 seconds
      // Fade Up
      if (led->get_value() == 0) 
      {
        byte intensity = random(100, 255);
        led->fade(intensity, duration);
      }
      // Fade Down
      else 
      {
        led->fade(0, duration);
      }
    }
  }
 }

?

?

?


RGB 遙控車 Arduino
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1耗盡型MOS FET產(chǎn)品目錄選型表
  2. 0.14 MB   |  2次下載  |  免費(fèi)
  3. 2TI系列-米爾TI AM62L核心板開發(fā)板-高能效低功耗嵌入式平臺
  4. 1.51 MB  |  次下載  |  免費(fèi)
  5. 3WILLSEMI韋爾20年半年度報告由代理分銷經(jīng)銷一級代理分銷經(jīng)銷
  6. 3.30 MB  |  次下載  |  免費(fèi)
  7. 4LRC 樂山無線電InTWSApplications家電由原廠代理分銷經(jīng)銷一級代理分銷經(jīng)銷供應(yīng)
  8. 85.84 KB  |  次下載  |  免費(fèi)
  9. 5LAT1596 一文說明白 STM32G4 雙 Bank 啟動與升級
  10. 0.64 MB   |  次下載  |  5 積分
  11. 6LAT1594_基于事件喚醒低功耗之介紹
  12. 0.37 MB   |  次下載  |  5 積分
  13. 7PT8P2309 觸控 A/D 型 8-Bit MCU規(guī)格書
  14. 4.05 MB   |  次下載  |  免費(fèi)
  15. 8PT8P2308 觸控 A/D 型 8-Bit MCU規(guī)格書
  16. 4.13 MB   |  次下載  |  免費(fèi)

本月

  1. 1美的電磁爐電路原理圖資料
  2. 4.39 MB   |  19次下載  |  10 積分
  3. 2反激式開關(guān)電源設(shè)計解析
  4. 0.89 MB   |  11次下載  |  5 積分
  5. 3耗盡型MOS FET產(chǎn)品目錄選型表
  6. 0.14 MB   |  2次下載  |  免費(fèi)
  7. 4簡易光伏控制器原理圖資料
  8. 0.07 MB   |  1次下載  |  5 積分
  9. 52EDL05x06xx系列 600V半橋門驅(qū)動器帶集成自舉二極管(BSD)手冊
  10. 0.69 MB   |  1次下載  |  免費(fèi)
  11. 6國產(chǎn)千兆網(wǎng)口芯片PT153S中文資料
  12. 1.35 MB   |  次下載  |  免費(fèi)
  13. 7斯丹電子 | 用于芯片測試系統(tǒng)的射頻干簧繼電器
  14. 5.11 MB  |  次下載  |  免費(fèi)
  15. 8SFI立昌ESD/TVS管原廠代理分銷經(jīng)銷一級代理分銷經(jīng)銷
  16. 294.76 KB  |  次下載  |  免費(fèi)

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935137次下載  |  10 積分
  3. 2開源硬件-PMP21529.1-4 開關(guān)降壓/升壓雙向直流/直流轉(zhuǎn)換器 PCB layout 設(shè)計
  4. 1.48MB  |  420064次下載  |  10 積分
  5. 3Altium DXP2002下載入口
  6. 未知  |  233095次下載  |  10 積分
  7. 4電路仿真軟件multisim 10.0免費(fèi)下載
  8. 340992  |  191448次下載  |  10 積分
  9. 5十天學(xué)會AVR單片機(jī)與C語言視頻教程 下載
  10. 158M  |  183360次下載  |  10 積分
  11. 6labview8.5下載
  12. 未知  |  81605次下載  |  10 積分
  13. 7Keil工具M(jìn)DK-Arm免費(fèi)下載
  14. 0.02 MB  |  73829次下載  |  10 積分
  15. 8LabVIEW 8.6下載
  16. 未知  |  65991次下載  |  10 積分