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!
![]()
collector.ino (25.9 KB)