error in using at commands

Hi guys!

I am having some problem the following peice of code.That I programmed for my garbage collector. To be specific at the switch statement.

here is the code segment

case 1:

  alpha = angle_deg;
  gamma = i_R;
  beta = i_L - alpha;

  tower_angle1 = 90 - beta; // angle y in diagram
  tower_angle2 = 180 - (beta + gamma + alpha) - tower_angle1; // angle x in diagram

  L_2 = (L_1 * sin(tower_angle2)) / sin(beta + gamma + alpha); // arm of angle beta

  AB = (L_2 * sin(beta)) / sin(90); // x axis
  BC = (L_2 * sin(180 - beta)) / sin(90); // yaxis

  ang_z = 90 - alpha;

  side_AN = (BC * sin(90)) / sin(alpha);

  ang_A = 180 - tower_angle2 - gamma;
  side_NM = (side_AN * sin(ang_A)) / sin(tower_angle2); //


  if (collector_R.decode(&data_R) == true) {
    if (data_R.decode_type == SONY) {
      switch (data_R.value) {
        case 1:
          if (data_L == 2)int north();
          break;

        case 2:
          if (data_L == 3)int east();
          break;

        case 3:
          if (data_L == 4)int south();
          break;

        case 4:
          if (data_L == 1)int west();
          break;
      }
    }
  }

After compiling the code it shows a error , i.e. no match for 'operator==' (operand types are 'decode_results' and 'int') in the following line :

 if (data_L == 1)int west();

The whole code is given in the attachment.

Pls help! :slight_smile: :slight_smile:

collector.ino (25.9 KB)

Post the complete error message.

data_L is an instantiation of decode_results class. The compiler is complaining because there is no == operator defined for that class. But you are not comparing it to another decode_results object but rather an integer. Did you mean to use data_L.value instead?

Also you have gotos in your code. That is considered very poor form by today's standards. You should restructure your code to get rid of those.

thank you!
for your reply. its me.
i only posted this. but i cant access that account right now. so i have to reply by this account.

i will surely work on the gotos.
and now talking about the data_L thing. understand what you are saying.
but it would be too great of you if you could show how to do it.

I am sorry for such programming, as i am a rookie(i am just 14 years old!)

hi steve thanks for replying
here's what you want

"no match for 'operator =='" (operand types are decode_result & int)

I am facing same error. Please let me know if someone fine exact information to solve this error.