I've added
pre
tags to engage the syntax highlighter, and preserve your formatting (what there is of it)
Start by indenting your code so it's actually readable - at the moment it's pretty much impossible to tell what is going on, other than the first couple of bits of code are duplicated:
#include <servo.h> class Smart_Segregator /* ... */ { public: int servo_pin; int moisture_sensor_pin; int touch_sensor_pin; int detect_moisture; int detect_touch; Servo servo; Smart_Segregator(int pin_1, int pin_2, int pin_3) { servo_pin = pin_1; moisture_sensor_pin = pin_2; touch_sensor_pin = pin_3; detect_moisture = 0; detect_touch = false; } void init() { Serial.begin(9600); servo.attach(servo_pin); servo.write(90); pinMode(moisture_sensor_pin, INPUT); pinMode(touch_sensor_pin, INPUT); Serial.println("Your Smart Segregator is ready to Segregate!"); } void dry_waste() { servo.write(0); } void wet_waste() { servo.write(180); } void neutral_state() { servo.write(90); } void execute() { detect_moisture =#include <servo.h>
class Smart_Segregator
So you have two classes called the same thing but the first one ends part way through a line of code...
THat looks like a copy'n'paste job gone very wrong - I'd start by thinking about what you do and don't need there and scrapping the dross before you even think about compiling.
If after that you still have compiler errors, this may help:
How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[
^]