New Cutter Code
New Cutter Code
New Cutter Code
h>
int convmotor=28;
int IRsensor=29;
int IRsensor1=30;// sensors 30,31 are dummy sensors for simulating the logic set from the ML model
int IRsensor2=31;// sensors 30,31, are being used to mimic a decision that will be done by the machine
learning choices... Setting any at some logic will give a decision..
int hasobstacle=HIGH;
int hasobstacle1=HIGH;
int hasobstacle2=HIGH;
int slap1=33;
int slap2=34;
int gong=35;
int LED=36;
void setup()
lcd.begin(16,2);
pinMode(convmotor,OUTPUT);
pinMode(IRsensor,INPUT);
pinMode(IRsensor1,INPUT);
pinMode(IRsensor2,INPUT);
pinMode(slap1,OUTPUT);
pinMode(slap2,OUTPUT);
pinMode(gong,OUTPUT);
pinMode(LED,OUTPUT);
pinMode(motorPin1,OUTPUT);
pinMode(motorPin2,OUTPUT);
void loop()
lcd.setCursor(0,0);
lcd.print("Vegeatable cutter");
lcd.setCursor(1,2);
hasobstacle= digitalRead(IRsensor);
if (hasobstacle==LOW)
digitalWrite(motorPin1,HIGH);
lcd.clear();
lcd.print("CONVEYOR ON");
delay(2000);
digitalWrite(motorPin1,LOW);
lcd.clear();
lcd.print("CONVEYOR OFF");
lcd.setCursor(1,2);
{
digitalWrite(motorPin1,HIGH);
delay(3000);
delay(500); //assume that this is time enough to set an impact knock on the veg
digitalWrite(slap1,LOW);
delay(100);//
digitalWrite(motorPin1,HIGH);
delay(43000);
delay(500);// assume that this is time enough to set an impact knock on the veg
digitalWrite(slap1,LOW);
delay(100);//
digitalWrite(gong,HIGH);
digitalWrite(LED,HIGH);
delay(3000);
lcd.clear();
lcd.print("Unknown product");
delay(2000);
else
delay(100);
else
digitalWrite(motorPin1,LOW);
lcd.clear();
lcd.print("CONVEYOR OFF");
delay(5000);