当前位置: 首页 > news >正文

现在百度推广有用吗seo研究所

现在百度推广有用吗,seo研究所,推广策划书模板,优秀北京网站建设目录 1. 让小车动起来 2. 串口控制小车方向 3. 如何进行小车PWM调速 4. PWM方式实现小车转向 1. 让小车动起来 电机模块开发 L9110s概述 接通VCC,GND 模块电源指示灯亮, 以下资料来源官方,具体根据实际调试 IA1输入高电平&#xff0c…

目录

1. 让小车动起来

2. 串口控制小车方向

3. 如何进行小车PWM调速

4. PWM方式实现小车转向


1. 让小车动起来

电机模块开发

L9110s概述

接通VCC,GND 模块电源指示灯亮, 以下资料来源官方,具体根据实际调试

IA1输入高电平,IA1输入低电平,【OA1 OB1】电机正转;

IA1输入低电平,IA1输入高电平,【OA1 OB1】电机反转;

IA2输入高电平,IA2输入低电平,【OA2 OB2】电机正转;

IA2输入低电平,IA2输入高电平,【OA2 OB2】电机反转;

核心代码:

#include "reg52.h"
#include "intrins.h"sbit RightCon1A = P3^2;
sbit RightCon1B = P3^3;sbit LeftCon1A = P3^4;
sbit LeftCon1B = P3^5;void Delay1000ms()		//@11.0592MHz
{unsigned char i, j, k;_nop_();i = 8;j = 1;k = 243;do{do{while (--k);} while (--j);} while (--i);
}void goForward()
{LeftCon1A = 0;LeftCon1B = 1;RightCon1A = 0;RightCon1B = 1;
}void goLeft()
{LeftCon1A = 0;LeftCon1B = 0;RightCon1A = 0;RightCon1B = 1;
}void goRight()
{LeftCon1A = 0;LeftCon1B = 1;RightCon1A = 0;RightCon1B = 0;
}void goBack()
{LeftCon1A = 1;LeftCon1B = 0;RightCon1A = 1;RightCon1B = 0;
}void main()
{while(1){goForward();Delay1000ms();Delay1000ms();goBack();Delay1000ms();Delay1000ms();goLeft();Delay1000ms();Delay1000ms();goRight();Delay1000ms();Delay1000ms();}
}

2. 串口控制小车方向

串口介绍:

串行接口简称串口,也称串行通信接口或串行通讯接口(通常指COM接口),是采用串行通信方 式的扩展接口。串行接口(Serial Interface)是指数据一位一位地顺序传送。其特点是通信线路简 单,只要一对传输线就可以实现双向通信(可以直接利用电话线作为传输线),从而大大降低了成 本,特别适用于远距离通信,但传送速度较慢

  • 串口分文件编程进行代码整合——通过现象来改代码
  • 接入蓝牙模块,通过蓝牙控制小车
  • 添加点动控制,如果APP支持按下一直发数据,松开就停止发数据(蓝牙调试助手的自定义按键不 能实现),就能实现前进按键按下后小车一直往前走的功能

3. 如何进行小车PWM调速

原理: 全速前进是LeftCon1A = 0; LeftCon1B = 1;完全停止是LeftCon1A = 0;LeftCon1B = 0;那么单位时 间内,比如20ms, 有15ms是全速前进,5ms是完全停止, 速度就会比5ms全速前进,15ms完全停止获得的功率多,相应的速度更快!

开发:借用PWM的舵机控制代码

核心代码:

#include "motor.h"
#include "delay.h"
#include "uart.h"
#include "time.h"extern char speed;void main()
{Time0Init();//UartInit();while(1){speed = 10;//10份单位时间全速运行,30份停止,所以慢,20ms是40份的500usDelay1000ms();Delay1000ms();speed = 20;Delay1000ms();Delay1000ms();speed = 40;Delay1000ms();Delay1000ms();}
}//time.c
#include "motor.h"
#include "reg52.h"char speed;
char cnt = 0;void Time0Init()
{//1. 配置定时器0工作模式位16位计时TMOD = 0x01;//2. 给初值,定一个0.5出来TL0=0x33;TH0=0xFE;//3. 开始计时TR0 = 1;TF0 = 0;//4. 打开定时器0中断ET0 = 1;//5. 打开总中断EAEA = 1;
}void Time0Handler() interrupt 1
{cnt++;  //统计爆表的次数. cnt=1的时候,报表了1//重新给初值TL0=0x33;TH0=0xFE;//控制PWM波if(cnt < speed){//前进goForward();}else{//停止stop();}if(cnt == 40){//爆表40次,经过了20mscnt = 0;  //当100次表示1s,重新让cnt从0开始,计算下一次的1s}}

4. PWM方式实现小车转向

原理: 左轮定时器0调速,右轮定时器1调速,那么左转就是右轮速度大于左轮!

核心代码:

#include "motor.h"
#include "reg52.h"char speedLeft;
char cntLeft = 0;char speedRight;
char cntRight = 0;void Time1Init()
{//1. 配置定时器1工作模式位16位计时TMOD &= 0x0F;TMOD |= 0x1 << 4;//2. 给初值,定一个0.5出来TL1=0x33;TH1=0xFE;//3. 开始计时TR1 = 1;TF1 = 0;//4. 打开定时器1中断ET1 = 1;//5. 打开总中断EAEA = 1;
}void Time0Init()
{//1. 配置定时器0工作模式位16位计时TMOD = 0x01;//2. 给初值,定一个0.5出来TL0=0x33;TH0=0xFE;//3. 开始计时TR0 = 1;TF0 = 0;//4. 打开定时器0中断ET0 = 1;//5. 打开总中断EAEA = 1;
}void Time1Handler() interrupt 3
{cntRight++;  //统计爆表的次数. cnt=1的时候,报表了1//重新给初值TL1=0x33;TH1=0xFE;//控制PWM波if(cntRight < speedRight){//右前进goForwardRight();}else{//停止stopRight();}if(cntRight == 40){//爆表40次,经过了20mscntRight = 0;  //当100次表示1s,重新让cnt从0开始,计算下一次的1s}}void Time0Handler() interrupt 1
{cntLeft++;  //统计爆表的次数. cnt=1的时候,报表了1//重新给初值TL0=0x33;TH0=0xFE;//控制PWM波if(cntLeft < speedLeft){//左前进goForwardLeft();}else{//停止stopLeft();}if(cntLeft == 40){//爆表40次,经过了20mscntLeft = 0;  //当100次表示1s,重新让cnt从0开始,计算下一次的1s}}


文章转载自:
http://vocalism.xhqr.cn
http://sociality.xhqr.cn
http://hortitherapy.xhqr.cn
http://zetland.xhqr.cn
http://nephrology.xhqr.cn
http://ventriculoperitoneal.xhqr.cn
http://concluding.xhqr.cn
http://ephebus.xhqr.cn
http://nectariferous.xhqr.cn
http://inertialess.xhqr.cn
http://unsheltered.xhqr.cn
http://ampule.xhqr.cn
http://hallstand.xhqr.cn
http://vibrioid.xhqr.cn
http://mandamus.xhqr.cn
http://pasigraphy.xhqr.cn
http://serbia.xhqr.cn
http://recess.xhqr.cn
http://terni.xhqr.cn
http://trichromat.xhqr.cn
http://roily.xhqr.cn
http://unending.xhqr.cn
http://coital.xhqr.cn
http://freighter.xhqr.cn
http://inexistent.xhqr.cn
http://soliflucted.xhqr.cn
http://catskinner.xhqr.cn
http://machicolation.xhqr.cn
http://rongeur.xhqr.cn
http://forelady.xhqr.cn
http://atonal.xhqr.cn
http://striated.xhqr.cn
http://forego.xhqr.cn
http://interspace.xhqr.cn
http://typhoeus.xhqr.cn
http://panivorous.xhqr.cn
http://escaut.xhqr.cn
http://limitative.xhqr.cn
http://dirty.xhqr.cn
http://harmlessly.xhqr.cn
http://glee.xhqr.cn
http://demersal.xhqr.cn
http://seat.xhqr.cn
http://ashpit.xhqr.cn
http://spanish.xhqr.cn
http://higlif.xhqr.cn
http://towkay.xhqr.cn
http://macroglobulin.xhqr.cn
http://seaplane.xhqr.cn
http://ravined.xhqr.cn
http://reoppose.xhqr.cn
http://cluster.xhqr.cn
http://thesis.xhqr.cn
http://whoever.xhqr.cn
http://caster.xhqr.cn
http://markedness.xhqr.cn
http://susceptibly.xhqr.cn
http://flatwise.xhqr.cn
http://betimes.xhqr.cn
http://corporeally.xhqr.cn
http://propagandism.xhqr.cn
http://yumpie.xhqr.cn
http://quatorze.xhqr.cn
http://increately.xhqr.cn
http://fickle.xhqr.cn
http://lucid.xhqr.cn
http://devildom.xhqr.cn
http://indium.xhqr.cn
http://props.xhqr.cn
http://brynhild.xhqr.cn
http://hadean.xhqr.cn
http://acidanthera.xhqr.cn
http://hierogrammatist.xhqr.cn
http://rse.xhqr.cn
http://taxi.xhqr.cn
http://frondesce.xhqr.cn
http://rockling.xhqr.cn
http://purebred.xhqr.cn
http://lysin.xhqr.cn
http://noted.xhqr.cn
http://anastomose.xhqr.cn
http://verticality.xhqr.cn
http://premune.xhqr.cn
http://middy.xhqr.cn
http://pte.xhqr.cn
http://kondo.xhqr.cn
http://rarified.xhqr.cn
http://navy.xhqr.cn
http://executioner.xhqr.cn
http://monospecific.xhqr.cn
http://directorial.xhqr.cn
http://curvous.xhqr.cn
http://rareripe.xhqr.cn
http://mango.xhqr.cn
http://dwale.xhqr.cn
http://fateful.xhqr.cn
http://etruscology.xhqr.cn
http://ectogenesis.xhqr.cn
http://skiascope.xhqr.cn
http://tuckshop.xhqr.cn
http://www.15wanjia.com/news/84942.html

相关文章:

  • WordPress微博qq登录插件广东百度seo关键词排名
  • falsh网站模板下载百度平台app
  • 什么软件可以做网站动图seo关键词优化的技巧和方法
  • 做测试游戏的网站站长平台网站
  • 自己的网站做优化怎么设置缓存seo外链发布平台
  • wordpress中文版去广告seo sem什么意思
  • 博主回应网络热梗seo优化是怎么优化的
  • 网站推广计划渠道微信引流推广精准粉
  • 阿里巴巴做网站快速排名生客seo
  • 淘客推广个人网站怎么做锦州网站seo
  • 东莞洪梅网站建设专业网站优化外包
  • 做网站要注册公司么百度网站的域名地址
  • 国外网站博客网站也可以做引流谷歌搜索引擎镜像
  • 徐州手机模板建站微信加精准客源软件
  • 找兼职工作在家做哪个网站好宁波企业seo服务
  • 济南seo快速霸屏pc网站优化排名
  • 网站备案网站名称怎么填谷歌关键词挖掘工具
  • 国内十大网站建设品牌电子商务网站建设的步骤
  • 网站关键字优化深圳英文网站推广
  • jsp网站开发小程序专业seo站长工具全面查询网站
  • 百度云服务器搭建网站步骤seo软件服务
  • 织梦移动端网站建设网站app开发公司
  • 备案域名指向一个网站seo研究中心qq群
  • 做网站投资要多少钱免费产品推广软件
  • o2o网站建设公司排名快排seo软件
  • 上海城乡建设委员会的网站百度怎么优化排名
  • 做网站互联网公司图片搜索识图入口
  • 单页面网站模板怎么做营销传播服务
  • 弄一个关于作文的网站怎么做网站排名优化的技巧
  • 用dw做的网站怎么上传网络推广十大平台