Commit 1ed4b4b5 authored by 957dd's avatar 957dd

update

parent c7b2bfce
controlcars0001
\ No newline at end of file
No preview for this file type
......@@ -3,8 +3,8 @@
#include <stdlib.h>
// 定义 PWM 引脚的 WiringPi 编号
#define PWM_PIN_SPEED 2
#define PWM_PIN_CHANGE 21
#define PWM_PIN_SPEED 21
#define PWM_PIN_CHANGE 2
#define SPEED_IN_1 24
#define SPEED_IN_2 26
// 定义 PWM 频率为 50Hz
......@@ -20,8 +20,8 @@ void pwm_speed() {
pinMode(PWM_PIN_SPEED,PWM_OUTPUT);
pinMode(PWM_PIN_CHANGE,PWM_OUTPUT);
pinMode(SPEED_IN_1,PWM_OUTPUT);
pinMode(SPEED_IN_2,PWM_OUTPUT);
pinMode(SPEED_IN_1,OUTPUT);
pinMode(SPEED_IN_2,OUTPUT);
pwmSetClock(PWM_PIN_SPEED,pwm_clock);//=19200*1000/(hz*2000)
pwmSetRange(PWM_PIN_SPEED,MAX_DUTY);
......
No preview for this file type
No preview for this file type
......@@ -64,11 +64,11 @@ void *AppExit(void *arg)//出现意外自动停止
void *Mqttbeat(void *arg)
{
printf("Mqttbeat start\n");
Delay_Ms(30,0);
Delay_Ms(15,0);
refresh_cam();
Delay_Ms(10,0);
refresh_cam();
Delay_Ms(10,0);
Delay_Ms(5,0);
while(1)
{
......@@ -84,7 +84,7 @@ void *Mqttbeat(void *arg)
void *opensh(void *arg)
{
Delay_Ms(10,0);
Delay_Ms(5,0);
printf("open cam\n");
opencamsh();//10s后打开火狐游览器并且进入网址
......@@ -153,6 +153,7 @@ int main(int argc, char *argv[]) {
printf("WiringPi setup failed!\n");
return 1;
}
pwm_speed() ;
Delay_Ms(10,0);
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment