int joystick = A0;
int B1A = 5;
int B1A = 6;
int motorspeed; //no motor in simulation

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode(joystick, INPUT);
pinMode(B1A, OUTPUT);
pinMode(B1B, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
Serial.println(analogRead(joystick));
//analogWrite(B1A, HIGH); in previous week
//analogWrite(B1B,LOW); in previous week
joystickValue = analogRead(joystick);
motorspeed = map(joystickValue, 0, 1023, 0, 255);
if (analogRead(joystick) == 512){
  analogWrite(B1A,0);
  analogWrite(B1B,0);
}
else if (analogRead(joystick) < 512){
  analogWrite(B1A, motorspeed);
  analogWrite(B1B, 0);
}
else (analogRead(joystick) > 512){
  analogWrite(B1A, 0);
  analogWrite(B1B, motorspeed);
}

}