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-rtos mbed QEI
Fork of ICRSEurobot13 by
Diff: main.cpp
- Revision:
- 21:167dacfe0b14
- Parent:
- 20:70d651156779
- Child:
- 22:6e3218cf75f8
--- a/main.cpp Tue Apr 09 15:33:36 2013 +0000
+++ b/main.cpp Tue Apr 09 19:24:31 2013 +0000
@@ -2,12 +2,12 @@
#include "Kalman.h"
#include "mbed.h"
#include "rtos.h"
-#include "Actuators/Arms/Arm.h"
-#include "Actuators/MainMotors/MainMotor.h"
-#include "Sensors/Encoders/Encoder.h"
-#include "Sensors/Colour/Colour.h"
-#include "Sensors/CakeSensor/CakeSensor.h"
-#include "Processes/Printing/Printing.h"
+#include "Arm.h"
+#include "MainMotor.h"
+#include "Encoder.h"
+#include "Colour.h"
+#include "CakeSensor.h"
+#include "Printing.h"
#include "coprocserial.h"
#include <algorithm>
@@ -50,7 +50,7 @@
/*
DigitalOut l1(LED1);
- Thread p(printingThread, NULL, osPriorityNormal, 2048);
+ Thread p(Printing::printingloop, NULL, osPriorityNormal, 2048);
l1=1;
Thread a(printingtestthread, NULL, osPriorityNormal, 1024);
Thread b(printingtestthread2, NULL, osPriorityNormal, 1024);
@@ -68,7 +68,11 @@
Kalman::start_predict_ticker(&predictthread);
//Thread::wait(osWaitForever);
- feedbacktest();
+ //feedbacktest();
+
+ Thread::wait(3500);
+ Thread printingThread(Printing::printingloop, NULL, osPriorityLow, 2048);
+ Thread::wait(osWaitForever);
}
@@ -78,12 +82,12 @@
void printingtestthread(void const*){
const char ID = 1;
float buffer[3] = {ID};
- registerID(ID,sizeof(buffer)/sizeof(buffer[0]));
+ Printing::registerID(ID,sizeof(buffer)/sizeof(buffer[0]));
while (true){
for(size_t i = 1; i != sizeof(buffer)/sizeof(buffer[0]); ++i){
buffer[i] = ID ;
}
- updateval(ID, buffer, sizeof(buffer)/sizeof(buffer[0]));
+ Printing::updateval(ID, buffer, sizeof(buffer)/sizeof(buffer[0]));
Thread::wait(200);
}
}
@@ -91,12 +95,12 @@
void printingtestthread2(void const*){
const char ID = 2;
float buffer[5] = {ID};
- registerID(ID,sizeof(buffer)/sizeof(buffer[0]));
+ Printing::registerID(ID,sizeof(buffer)/sizeof(buffer[0]));
while (true){
for(size_t i = 1; i != sizeof(buffer)/sizeof(buffer[0]); ++i){
buffer[i] = ID;
}
- updateval(ID, buffer, sizeof(buffer)/sizeof(buffer[0]));
+ Printing::updateval(ID, buffer, sizeof(buffer)/sizeof(buffer[0]));
Thread::wait(500);
}
}
