×

使用模拟操纵杆控制Arduino 4WD智能汽车

消耗积分:0 | 格式:zip | 大小:1.22 MB | 2022-10-18

分享资料个

描述

描述

 

大家好!这是我的下一个项目 - 带有操纵杆控制器的 Arduino 4WD RC 汽车或使用模拟操纵杆控制 Arduino 4WD 智能汽车是多么容易。

这款 RC 操纵杆控制的汽车使用 NRF24l01 作为发射器和接收器。它在开放空间的射程可达 1 公里。也非常简单,易于制作。

1.操纵杆控制器

操纵杆组件:

 
img_20171216_125006_eOH7V1hRi1.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
Arduino UNO 板
 

 

 
img_20171216_125148_xPoewld5Q9.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
Funduino 操纵杆护罩
 

操纵杆盾位于您的 Arduino 顶部,并将其变成一个简单的控制器。7 个瞬时按钮(4 个大按钮、2 个小按钮和一个操纵杆选择按钮)和一个两轴拇指操纵杆使您的 Arduino 功能达到旧任天堂控制器的水平。本机还提供诺基亚 5110 LCD 和 nRF24L01 接口。

特征:

  • nRF24L01接口
  • 诺基亚 5110 液晶界面
  • 蓝牙接口
  • I2C 接口
  • 与 Arduino 兼容
  • 工作电压3.5V或5V
 
 
 
 
img_20171216_125048_oA5wEmYH5z.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
 
1 / 32.4GHz 20dBm nRF24L01P+PA+LNA无线传输模块(屏蔽壳)
 

实际上,它被标记为BTE16-49 - nRF24L01+RFX2401C +PA+LNA无线通信模块,带天线屏蔽壳2.4GHz 20dbm 1000m。

卖方指定的特征:

  • 2.4GHz 全球开放 ISM 频段,免许可使用
  • 最高运行速度2Mbps,高效GFSK调制,传输音频、视频
  • 125个通道,满足多点通信和跳频通信需求
  • 内置硬件CRC错误检测和点对多点通信控制的地址
  • 工作电压3.0-3.6V,发射功率20dBm(VDD=3.3V)
  • 外置 2.4GHz 天线
  • 2.54mm间距管脚,完全兼容无需功放模块接口,方便更换提升距离
  • 传输距离可达 1000 m
 
img_20171217_091405_amQFmvZWwp.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
移动电源
 

2.操纵杆控制器

 
 
 
 
img_20171217_091328_K3DVNJ5gA7.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
 
1 / 2操纵杆控制器
 

Joystick Shield 有 4 个大按钮 + 2 个小按钮 + 操纵杆选择按钮和一个两轴拇指操纵杆(X 轴从 0 到 1023,Y 轴从 0 到 1023)一个简单的控制器。在我的草图中,按钮向上用于蜂鸣器(喇叭),右按钮 - 前灯(LED + 电阻 200 欧姆),左按钮 - 后灯(LED + 电阻 200 欧姆)。不使用其他按钮。

操纵杆测试:

 
 
 
 
__(3)_Ykd3uAp4Tr.png?auto=compress%2Cformat&w=740&h=555&fit=max
 
1 / 3打开 Arduino IDE
 

空闲状态:X=499, Y=502, Up=1, Right=1, Down=1, Left=1

 
__(7)_UdVHcxyWcI.png?auto=compress%2Cformat&w=740&h=555&fit=max
打开串行监视器
 

 

 
 
 
 
__(8)_NZSuedHMIh.png?auto=compress%2Cformat&w=740&h=555&fit=max
 
1 / 7操纵杆向上 Y=1023
 

3. Arduino 4WD 遥控车

 

 

 
 
 
 
img_20171126_161008_A3wKz2KY9O.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
 
1 / 9
 

 

 
rc_car_wd_wo4F6O9wPA.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
接线图
 

按照上面的接线图进行连接。

注意:在上传代码之前,您必须从 Arduino Uno 板(引脚 0、1)断开跳线。

一旦您正确完成所有步骤,汽车就可以出发了!

为 Arduino Car 和 Joystick 控制器供电后,您可以使用 Joystick 通过前后移动操纵杆来控制汽车,汽车将向前或向后移动,左右移动操纵杆将使汽车左右转向。

敬请关注!


声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !

'+ '

'+ '

'+ ''+ '
'+ ''+ ''+ '
'+ ''+ '' ); $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code ==5){ $(pop_this).attr('href',"/login/index.html"); return false } if(data.code == 2){ //跳转到VIP升级页面 window.location.href="//m.obk20.com/vip/index?aid=" + webid return false } //是会员 if (data.code > 0) { $('body').append(htmlSetNormalDownload); var getWidth=$("#poplayer").width(); $("#poplayer").css("margin-left","-"+getWidth/2+"px"); $('#tips').html(data.msg) $('.download_confirm').click(function(){ $('#dialog').remove(); }) } else { var down_url = $('#vipdownload').attr('data-url'); isBindAnalysisForm(pop_this, down_url, 1) } }); }); //是否开通VIP $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code == 2 || data.code ==5){ //跳转到VIP升级页面 $('#vipdownload>span').text("开通VIP 免费下载") return false }else{ // 待续费 if(data.code == 3) { vipExpiredInfo.ifVipExpired = true vipExpiredInfo.vipExpiredDate = data.data.endoftime } $('#vipdownload .icon-vip-tips').remove() $('#vipdownload>span').text("VIP免积分下载") } }); }).on("click",".download_cancel",function(){ $('#dialog').remove(); }) var setWeixinShare={};//定义默认的微信分享信息,页面如果要自定义分享,直接更改此变量即可 if(window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger'){ var d={ title:'使用模拟操纵杆控制Arduino 4WD智能汽车',//标题 desc:$('[name=description]').attr("content"), //描述 imgUrl:'https://'+location.host+'/static/images/ele-logo.png',// 分享图标,默认是logo link:'',//链接 type:'',// 分享类型,music、video或link,不填默认为link dataUrl:'',//如果type是music或video,则要提供数据链接,默认为空 success:'', // 用户确认分享后执行的回调函数 cancel:''// 用户取消分享后执行的回调函数 } setWeixinShare=$.extend(d,setWeixinShare); $.ajax({ url:"//www.obk20.com/app/wechat/index.php?s=Home/ShareConfig/index", data:"share_url="+encodeURIComponent(location.href)+"&format=jsonp&domain=m", type:'get', dataType:'jsonp', success:function(res){ if(res.status!="successed"){ return false; } $.getScript('https://res.wx.qq.com/open/js/jweixin-1.0.0.js',function(result,status){ if(status!="success"){ return false; } var getWxCfg=res.data; wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId:getWxCfg.appId, // 必填,公众号的唯一标识 timestamp:getWxCfg.timestamp, // 必填,生成签名的时间戳 nonceStr:getWxCfg.nonceStr, // 必填,生成签名的随机串 signature:getWxCfg.signature,// 必填,签名,见附录1 jsApiList:['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 wx.onMenuShareTimeline({ title: setWeixinShare.title, // 分享标题 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享给朋友”按钮点击状态及自定义分享内容接口 wx.onMenuShareAppMessage({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 type: setWeixinShare.type, // 分享类型,music、video或link,不填默认为link dataUrl: setWeixinShare.dataUrl, // 如果type是music或video,则要提供数据链接,默认为空 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ”按钮点击状态及自定义分享内容接口 wx.onMenuShareQQ({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 wx.onMenuShareWeibo({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 wx.onMenuShareQZone({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); }); }); } }); } function openX_ad(posterid, htmlid, width, height) { if ($(htmlid).length > 0) { var randomnumber = Math.random(); var now_url = encodeURIComponent(window.location.href); var ga = document.createElement('iframe'); ga.src = 'https://www1.elecfans.com/www/delivery/myafr.php?target=_blank&cb=' + randomnumber + '&zoneid=' + posterid+'&prefer='+now_url; ga.width = width; ga.height = height; ga.frameBorder = 0; ga.scrolling = 'no'; var s = $(htmlid).append(ga); } } openX_ad(828, '#berry-300', 300, 250);