The day before I was having problem with Force Sensor input and Buzzer Output. So I tried to it again on a completely separate circuit.
Here’s the codes.
//try buzzer and force sensor
int buzzPin = 5; PWM 5
int forcePin = 5; Analog 5
int forceVal = analogRead(forcePin);
int thisPitch = map(forceVal, 100, 1000, 500, 600) //freq 500 to 600
thisPitch = constrain(thisPitch,500,600) //safety net
if (forceVal > 100)