Beginner question about Vibe motor and force sensor and LEDs

I’m working on a project for a class and I am having some issues with the code.

I’m using a vibe motor board, two Lily pad LEDs and a force sensor.

Here’s the code I have:

int LEDpin =11; 
int fsrReading; 
int Vibepin = 10; 
int fsrAnalogPin = 17; 

void setup(void) {
  Serial.begin(9600); 
  pinMode(LEDpin, OUTPUT); 
  pinMode(Vibepin, OUTPUT); 
  pinMode(fsrAnalogPin, INPUT); 
  
} 

void loop(void) {
 fsrReading = analogRead(fsrAnalogPin); 
Serial.print("Analog reading ="); 
Serial.print(fsrReading); 

if (fsrReading <10) {
  analogWrite(HIGH, LEDpin);
}
if (fsrReading <10) {
  digitalWrite(HIGH, Vibepin); 
}

  
  
}

I’m thinking this will work? I know the last part needs something added, I need to add an argument for when there’s no pressure applied to keep LEDs and vibe motors off.

I am not sure how to do that.

Sorry I have never touched code before.

I’m thinking this will work?

Are you, or aren’t you?

Which Arduino has 17 analog pins?

if (fsrReading <10) {
  analogWrite(HIGH, LEDpin);
}
if (fsrReading <10) {
  digitalWrite(HIGH, Vibepin); 
}

You can do more than one thing in the body of an if statement.

You should post some details about this vibe motor BEFORE you destroy your Arduino. It is not meant to power motors directly.

  pinMode(fsrAnalogPin, INPUT); 
 fsrReading = analogRead(fsrAnalogPin);

These statements don’t go together. Analog pins are input only. The pinMode() function doesn’t do anything for analog pins. It will set the digital part of that pin to input, but that is not necessary when using it as an analog pin.

I haven't changed the pin numbers yet in the code.

As for the if statement, I didn't know that, that does make more sense though.

The vibe motor is the lily pad vibe board, I know how to create the circuit it's just the code I have issues with. I am using the Lily pad simple board.

Okay so the force sensor (with the resistor) should be connected to an analog input pin as well as the LEDs? and the Vibe motor should be a digital output?

Okay so the force sensor (with the resistor) should be connected to an analog input pin

Yes.

as well as the LEDs?

If you think that there is some way that you are going to read an analog voltage from them. I don’t, myself.

and the Vibe motor should be a digital output?

Yes. A PWM one of you want to change speed.