2018 revision to classic DataBus AVC code.
Dependencies: LSM303DLM Servo SerialGraphicLCD L3G4200D IncrementalEncoder SimpleShell
Revision 35:c42e7e29c3bd, committed 2018-12-31
- Comitter:
- shimniok
- Date:
- Mon Dec 31 23:34:28 2018 +0000
- Parent:
- 34:2f7ebc88596d
- Child:
- 36:3095e00eef37
- Commit message:
- Added servo control for esc and steering
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Servo.lib Mon Dec 31 23:34:28 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/simon/code/Servo/#36b69a7ced07
--- a/SimpleShell.lib Sat Dec 29 15:24:47 2018 +0000 +++ b/SimpleShell.lib Mon Dec 31 23:34:28 2018 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/shimniok/code/SimpleShell/#afe994ca0e49 +https://os.mbed.com/users/shimniok/code/SimpleShell/#1a8c5fce8895
--- a/main.cpp Sat Dec 29 15:24:47 2018 +0000 +++ b/main.cpp Mon Dec 31 23:34:28 2018 +0000 @@ -10,6 +10,7 @@ #include "stats_report.h" #include "SDBlockDevice.h" #include "FATFileSystem.h" +#include "Servo.h" #include "SimpleShell.h" #include "Config.h" #include "Updater.h" @@ -35,6 +36,8 @@ InterruptIn lbutton(LBUTTON, PullUp); // button interrupts InterruptIn cbutton(CBUTTON, PullUp); InterruptIn rbutton(RBUTTON, PullUp); +Servo steer(STEERING); +Servo esc(THROTTLE); /////////////////////////////////////////////////////////////////////////////// // Idle hook @@ -129,7 +132,15 @@ SimpleShell sh("/log"); void test(int argc, char **argv) { - printf("Hello world!\n"); + //printf("Hello world!\n"); + char file[32]; + + for (int i=30; i < 40; i++) { + sprintf(file, "/log/%04d.csv", i); + printf("removing <%s>\n", file); + int stat = remove(file); + printf("return: %d\n", stat); + } } void stats(int argc, char **argv) { @@ -228,6 +239,9 @@ printf("Bootup...\n"); fflush(stdout); + steer = 0.50; + esc = 0.00; + printf("Loading config...\n"); config.add("intercept_distance", Config::DOUBLE); config.add("waypoint_threshold", Config::DOUBLE); @@ -250,7 +264,7 @@ config.add("steer_scale", Config::DOUBLE); config.add("gyro_scale", Config::DOUBLE); config.add("gps_valid_speed", Config::DOUBLE); - + if (config.load("/etc/2018cfg.txt")) { printf("error loading config\n"); }
--- a/mbed_app.json Sat Dec 29 15:24:47 2018 +0000 +++ b/mbed_app.json Mon Dec 31 23:34:28 2018 +0000 @@ -2,7 +2,7 @@ "target_overrides": { "*": { "rtos.idle-thread-stack-size": 256, - "rtos.main-thread-stack-size": 4096, + "rtos.main-thread-stack-size": 8192, "rtos.thread-stack-size": 512, "platform.default-serial-baud-rate": 115200, "platform.stdio-baud-rate": 115200,