int Feature1;
const byte Feature = 4;
const byte pause =5;
const byte DN =3;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(Feature, INPUT_PULLUP);
pinMode(pause, INPUT_PULLUP);
Serial.println("Feature1 = 0");
Feature1 = 0;
DRP(0,0," WAIT ");
Serial.println("Feature1 = 1");
Feature1 = 1;
DRP(0,0," WAIT ");
}
void loop() {
// put your main code here, to run repeatedly:
}
//================================================================================
// Routine keeps table and weight close to gather to decrease up/dn travel
// Routine also adjusts while in down/wait periods
// Note could not get Routine to work without digitalRead grnd pin 5 [Feature enb]
// Don't understand difference between digitalRead = 0 vs interger = 0
// I must be missing something
//---------------------------------------------------------------------------------
//---------------------------------------------------------------------------------
void DRP( int x,int utime , String cmd) // x = 3,2,1,0 contact = z = 0 = dn/wait ,7= other
{ //Feature1 = 0; // installed //
if((cmd == " DN# ") || (cmd == " WAIT ")) { goto DnWait; } // tray down or waiting [ floating weight ]
goto nock; //
DnWait: // cannot set an integer =0 as feature.. need grnd actual pin ?? DON'T UNDERSTAND
if(digitalRead(Feature) != HIGH) { goto nock; } // must have this for some reason ???? Feature is Pin D4 grounded
if(Feature1 != 0) { goto nock; } // NOT WORK
if(digitalRead(pause) == LOW) { digitalWrite(DN,LOW); goto nock; } // pause is switches removing ground [weight clears tray]
digitalWrite(DN,HIGH); // weight sw contacts tray start DN when Weight is Contacting
// lcd.setCursor(19,0); lcd.print(x); //
Serial.println("wait");
delay(250); //
digitalWrite(DN,LOW); // STOP DN after 250 ms hopefully Weight !Contacting
goto nock1; //
nock: //
//lcd.setCursor(19,0); lcd.print(x); // update LCd display
Serial.println("nock");
delay(250); //
nock1: //
// BrkKey = kpd.getKey(); // 1/4 sec interval BREAK KEY check
Serial.println("nock1");
} //
//=========================================================================