first commit

This commit is contained in:
Vattana 2023-05-16 14:51:28 +02:00
parent b77ae394b3
commit 13011ab45c
9 changed files with 57 additions and 0 deletions

Binary file not shown.

51
SensorCode/SensorCode.ino Normal file
View File

@ -0,0 +1,51 @@
#include <Servo.h>
Servo serv;
int pin = A0; //input Velostat pin
int pinServo = 9; //servo pin
float sensorVal;
float voltage;
float voltageCal;
float voltageScale;
float angle;
float Weight;
//Calibration
float offset = 2.585;
float scale = -0.0008;
float bias = 11;
void setup() {
Serial.begin(9600);
serv.attach(pinServo); //attach servo pin
pinMode(pin,INPUT_PULLUP);
digitalWrite(pin, HIGH);
}
void loop() {
sensorVal = analogRead(pin);
voltage = sensorVal * (5.0 / 1023.0);
//voltageCal = voltage - bias;
//voltageScale = abs(voltageCal / scale);
//voltageScale = (scale*voltageCal)-offset;
angle = voltage*54.54;
//angle = map(voltage,0,3.3,0,180);
//Weight = (voltage-offset)/scale;
//Serial Printing
Serial.print(sensorVal);
Serial.print(" , ");
Serial.print(voltage);
Serial.print(" , ");
Serial.print(Weight);
Serial.print(" , ");
Serial.println(angle);
serv.write(angle);
delay(500);
}

2
SensorCode/desktop.ini Normal file
View File

@ -0,0 +1,2 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\74.0.3.0\GoogleDriveFS.exe,23

BIN
Template_Report.docx Normal file

Binary file not shown.

2
desktop.ini Normal file
View File

@ -0,0 +1,2 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\74.0.3.0\GoogleDriveFS.exe,23

2
image/desktop.ini Normal file
View File

@ -0,0 +1,2 @@
[.ShellClassInfo]
IconResource=C:\Program Files\Google\Drive File Stream\74.0.3.0\GoogleDriveFS.exe,23

BIN
image/sensor.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
image/sensor.SLDPRT Normal file

Binary file not shown.

BIN
image/sensor_drawing.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB