Using Sensors with Arduino

Hello guys, we have this code to drive stepper motor, we are trying to make a garage door that rotates 90 degrees. We have an analog load sensor and digital ultrasonic proximity sensor. We need to rotate stepper motor +90 degrees when the sensor is 1 or High and -90 degrees when the sensor is 0 or Low but we don't know how to get sensors output and integrate it. Motor : 28BYJ48 Driver board: ULN2003A

#include  <Stepper.h>

int motorPin1 =8;
int motorPin2=9;
int motorPin3=10;
int motorPin4=11;


#define ADIM 128  

Stepper stepKontrol (ADIM, motorPin1, motorPin3, motorPin2, motorPin4);

int adimSayisi;

void setup() {
stepKontrol.setSpeed(400);  
}
void loop()
{ 
stepKontrol.setSpeed(200); 
adimSayisi= 512;  
stepKontrol.step(-512);  
stepKontrol.setSpeed(400);
adimSayisi=-128; 
delay(1500);   
}

what does your "loop" so far?

about the sensors, start with searching for examples for your ultrasonic sensor (should be available) and try to understand it.

Xertaw:
What's wrong with this code?

Maybe nothing, but seems you don't understand what the first, simple code does or what it should do. Otherwise you would just explain.. no?

It’s tough to say how you do it without the links to the devices. If one is analog then you need to base the movement in a value and it maybe the same case for the prox sensor. I doubt you get a high or low from either unless the prox is set that way.