Error Correction

Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\PRITHV~1\AppData\Local\Temp\arduino_modified_sketch_879284\sketch_sep11a.ino: In function 'void loop()':

sketch_sep11a:38: error: expected primary-expression before 'else'

else (x > backward) // Change the value for adjusting sensitivity

^

sketch_sep11a:38: error: expected ';' before 'else'

C:\Users\PRITHV~1\AppData\Local\Temp\arduino_modified_sketch_879284\sketch_sep11a.ino: At global scope:

sketch_sep11a:1: error: expected unqualified-id before numeric constant

#define forward 340 // Change this value to change senstivity for forward direction /-Default 340-/ X

^

C:\Users\PRITHV~1\AppData\Local\Temp\arduino_modified_sketch_879284\sketch_sep11a.ino:58:6: note: in expansion of macro 'forward'

void forward()

^

sketch_sep11a:2: error: expected unqualified-id before numeric constant

#define backward 340 // Change this value to change senstivity for backward direction /-Default 400-/ X

^

C:\Users\PRITHV~1\AppData\Local\Temp\arduino_modified_sketch_879284\sketch_sep11a.ino:68:6: note: in expansion of macro 'backward'

void backward()

^

sketch_sep11a:3: error: expected unqualified-id before numeric constant

#define left 340 // Change this value to change senstivity for left direction /-Default 340-/ Y

^

C:\Users\PRITHV~1\AppData\Local\Temp\arduino_modified_sketch_879284\sketch_sep11a.ino:78:6: note: in expansion of macro 'left'

void left()

^

sketch_sep11a:4: error: expected unqualified-id before numeric constant

#define right 340 // Change this value to change senstivity for right direction /-Default 400-/ Y

^

C:\Users\PRITHV~1\AppData\Local\Temp\arduino_modified_sketch_879284\sketch_sep11a.ino:88:6: note: in expansion of macro 'right'

void right()

^

exit status 1
expected primary-expression before 'else'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

You have a name collision between your macro (#define) names and your function names.

You need to use unique names.

It's common practice to make macro names ALL_UPPERCASE_WITH_UNDERSCORES to clearly identify them as macros. Following that practice would have avoided the name collision. However, these names "forward", "right" aren't very descriptive. I recommend giving them names that clearly describe their meaning. In this way the code becomes self-documenting.

You'd get better help if you showed us your code but

else (x > backward) // Change the value for adjusting sensitivity

That should probably be something a bit more like

else if (x > backward) // etc

pert:
You have a name collision between your macro (#define) names and your function names.

You need to use unique names.

It's common practice to make macro names ALL_UPPERCASE_WITH_UNDERSCORES to clearly identify them as macros. Following that practice would have avoided the name collision. However, these names "forward", "right" aren't very descriptive. I recommend giving them names that clearly describe their meaning. In this way the code becomes self-documenting.

Thanks buddy i figured out the mistake