Gerardo Hernandez / Mbed 2 deprecated SeaDragon0726

Dependencies:   mbed ros_lib_kinetic

Files at this revision

API Documentation at this revision

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);
     }