I am making a machine that measures the coefficient of friction on a clutch disc used in drag racing. The machine will put load on a cell from friction applied to the disc.
I want to record 10 samples in 1 second intervals after pressing a button and I want the intervals to begin after the load goes above a predefined value so that it will be easy to compare the graphs.
I tried this code below but have two problems:
1. It returns the 1st value measured for each cycle of the for loop
2. Much of the time I get a some packets were lost message.
If you have any suggestions, to improve this thanks in advance.
Code: Select all
Private Sub ifKit_SensorChange(ByVal sender As Object, ByVal e As Phidgets.Events.SensorChangeEventArgs) Handles phidgetIFK.SensorChange
Dim i As Integer = 0
Dim stopwatch As Stopwatch = stopwatch.StartNew
If buttonState = 1 Then
For i = 0 To 10
TextBoxData.AppendText(Environment.NewLine & phidgetIFK.sensors(0).Value)
buttonState = 0