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 ros_lib_kinetic
Revision 1:62257cc9f659, committed 2018-08-01
- Comitter:
- ElevatedSounds
- Date:
- Wed Aug 01 07:10:51 2018 +0000
- Parent:
- 0:4735537ba7a7
- Commit message:
- Leak Sensor code
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4735537ba7a7 -r 62257cc9f659 main.cpp --- a/main.cpp Wed Jul 25 20:39:56 2018 +0000 +++ b/main.cpp Wed Aug 01 07:10:51 2018 +0000 @@ -3,20 +3,16 @@ #include <std_msgs/Int16.h> #include <std_msgs/Bool.h> DigitalIn leakSensor(PC_2); -DigitalIn killSwitch(PC_3); DigitalOut myled(LED1); ros::NodeHandle nh; std_msgs::Bool leak_msg; ros::Publisher leak_publisher("leak", &leak_msg); -std_msgs::Bool killSwitch_msg; -ros::Publisher killSwitch_publisher("killSwitch", &killSwitch_msg); int main() { nh.initNode(); nh.advertise(leak_publisher); - nh.advertise(killSwitch_publisher); while (1) { @@ -29,17 +25,6 @@ leak_msg.data = 0; } leak_publisher.publish(&leak_msg); - - if(killSwitch) - { - killSwitch_msg.data = 1; - } - else - { - killSwitch_msg.data = 0; - } - killSwitch_publisher.publish(&killSwitch_msg); - nh.spinOnce(); wait_ms(200); }