9 #include <sensor_msgs/Range.h> 17 #if defined(TARGET_LPC1768) 18 PinName analog_pin = p20;
19 #elif defined(TARGET_KL25Z) || defined(TARGET_NUCLEO_F401RE) 20 PinName analog_pin = A0;
22 #error "You need to specify a pin for the mic" 33 sample = AnalogIn(pin_num).read_u16()/4;
39 sample= 1309/(sample-3);
40 return (sample - 1)/100;
51 range_msg.radiation_type = sensor_msgs::Range::INFRARED;
void publish(const boost::shared_ptr< M > &message) const
sensor_msgs::Range range_msg
float getRange(PinName pin_num)
ros::Publisher pub_range("range_data",&range_msg)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
unsigned long range_timer