Requirements
Arduino
10K Ohm Resistor
Force sensor
Wires
Circuit
Program
The program for force sensor is simple
int pinX=0; //variables
int dataX;
void setup()
{
Serial.begin(9600); //setup serial speed
}
void loop()
{
dataX=analogRead(pinX); // read a value
Serial.println(dataX);//send a value to PC
delay(100);//regulate a time
}
or you can use more shorter program
void setup()
{
Serial.begin(9600); //setup serial speed
}
void loop()
{
Serial.println(analogRead(0));//read and send a value to PC
delay(100);//regulate a time
}
whichever you want
Experiment Movie
0 件のコメント:
コメントを投稿