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.
Diff: main.cpp
- Revision:
- 5:90bf5f0d86e9
- Parent:
- 0:7e6b349182bc
- Child:
- 6:e9b1684a9c00
--- a/main.cpp Mon Aug 13 18:23:02 2018 +0000
+++ b/main.cpp Mon Aug 13 21:54:37 2018 +0000
@@ -7,10 +7,11 @@
DigitalOut on(D1);
DigitalOut up(D2);
DigitalOut down(D3);
-
+]
bool manual = false;
Serial pc(USBTX, USBRX, 57600);
+
Timer t;
EventQueue queue;
@@ -18,6 +19,13 @@
Wheelchair smart(xDir,yDir, &pc, &t);
Thread thread;
+void messageCb(const std_msgs::String& command){
+ myled = 1; // turn on the led
+ commandRead.data = command.data;
+}
+
+ros::Subscriber<std_msgs::String> sub("toggle_led", &messageCb);
+
int main(void)
{
queue.call_every(SAMPLEFREQ, &smart, &Wheelchair::compass_thread);
@@ -100,3 +108,7 @@
}
+
+
+
+