ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

i figure it out.the code should be like this.

void pwm( const std_msgs::String& cmd_msg)
{
  if (cmd_msg.data[0]=='q')
  {
    digitalWrite (13, HIGH); 
     digitalWrite (12, LOW);
  }
  else if (cmd_msg.data[0]=='a')
  {
    digitalWrite (12, HIGH);
    digitalWrite (13,LOW); 
  }

thank you for all.for the effort.

i figure it out.the code should be like this.

void pwm( const std_msgs::String& cmd_msg)
{
  if (cmd_msg.data[0]=='q')
  {
    digitalWrite (13, HIGH); 
     digitalWrite (12, LOW);
  }
  else if (cmd_msg.data[0]=='a')
  {
    digitalWrite (12, HIGH);
    digitalWrite (13,LOW); 
  }

thank you for all.for the effort.effort. @lucasw @billy @maarten and @lagankapoor