Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
- Committer:
- st17099ng
- Date:
- 2019-08-28
- Revision:
- 1:72b8490a4ece
- Parent:
- 0:bba4760cb391
File content as of revision 1:72b8490a4ece:
#include "mbed.h"
#include "Help.h"
Serial pc(USBTX,USBRX);
DigitalOut POWER_LED(D5);
static int direct,speed;
static char wheel_RF,wheel_LF;
static char wheel_RB,wheel_LB;
static char arm_moter;
int main(void)
{
POWER_LED = 1;
speed = fast;
direct = SBREAK;
format_data(&wheel_RF);
format_data(&wheel_LF);
format_data(&wheel_RB);
format_data(&wheel_LB);
format_data(&arm_moter);
while(1) {
set_emg();
set_direct(&direct);
set_speed(&speed);
set_mot(&arm_moter, cir, cro);
if(direct != 0) {
set_tire(&wheel_RF, &wheel_RB, direct, 'R', speed);
set_tire(&wheel_LF, &wheel_LB, direct, 'L', speed);
} else {
set_slide(&wheel_RF,&wheel_LF,&wheel_RB,&wheel_LB,r1,l1, speed);
}
write_data(Rf_add,wheel_RF);
write_data(Lf_add,wheel_LF);
write_data(Rb_add,wheel_RB);
write_data(Lb_add,wheel_LB);
write_data(Mot1add,arm_moter);
/*
pri("\033[2J");
pri("\033[1;1H wheel_RF:0x%x",wheel_RF);
pri("\033[2;1H wheel_LF:0x%x",wheel_LF);
pri("\033[3;1H wheel_RB:0x%x",wheel_RB);
pri("\033[4;1H wheel_LB:0x%x",wheel_LB);
pri("\033[5;1H arm_moter:0x%x",arm_moter);
pri("\033[6;1H direct:%d",direct);
pri("\033[7;1H speed:%d",speed);
*/
}
}