Go Down

Topic: Arduino UNO , FSR's coding (Read 1 time) previous topic - next topic

JVaughan

Hi, I am an electrical engineering student with very little knowledge in programming.

I have a project using the Arduino UNO and four FSR's, the project is the measurement of heel, toe contact in sit to stand, basically to predict when someone with Orthostatic Hypotension is about to stand up. I can get code for the individual FSR's but that isn't good enough. When the four sensors are on there will be an output force whilst sitting , this must be the standard force for the subject whilst seated, when this force is exceeded it will engage the sit to stand and read the data to LabView.

Any help would be greatly appreciated

PaulS

Quote
Hi, I am an electrical engineering student with very little knowledge in programming.

I was a Mechanical Engineering student 38 years ago. Computer programming class were available to Engineers then. I find it hard to believe, what with the proliferation of computers that this is not still the case. This is a cop out.

Quote
I can get code for the individual FSR's but that isn't good enough.

What you have is all you can get. It is up to you to interpret the data correctly.

Quote
When the four sensors are on there will be an output force whilst sitting

So, you have a baseline.

Quote
when this force is exceeded it will engage the sit to stand and read the data to LabView.

So, what is the problem?

JVaughan

I was incoherent in my last post. I do java programming but I am not good at it. I have code that outputs data from the four FSR's to a virtual serial port interface on my laptop but the data I get is only from the four individual FSR'S.

What I need is code that will recognise that the four FSR's are one which in turn means the system is on, but if there are one or more of the FSR's off then the whole system is off.

I then need the code to be able to differentiate when the system is active, between the pressure of the FSR's on the feet whilst sitting and the change in pressure when about to stand.

Hope that is more clear

JVaughan

I was incoherent in my last post. I do java programming but I am not good at it. I have code that outputs data from the four FSR's to a virtual serial port interface on my laptop but the data I get is only from the four individual FSR'S.

What I need is code that will recognise that the four FSR's are one which in turn means the system is on, but if there are one or more of the FSR's off then the whole system is off.

I then need the code to be able to differentiate when the system is active, between the pressure of the FSR's on the feet whilst sitting and the change in pressure when about to stand.

Hope that is more clear

PaulS

Quote
I have code that outputs data from the four FSR's to a virtual serial port interface on my laptop

Where is it?

Quote
but the data I get is only from the four individual FSR'S.

And the problem is? It is up to you to add, multiply, bit-shift, ignore, divide, raise one value to the power of another, etc. to get the 4 individual values into one conglomerate value.

Quote
What I need is code that will recognise that the four FSR's are one

They aren't one. So, you are out of luck there.

Quote
which in turn means the system is on, but if there are one or more of the FSR's off then the whole system is off.

You need to compare the 4 values to some threshold. If all 4 values are above the threshold, do one thing. If one or more is not, do something else. Engage your brain, for a change.

Quote
I then need the code to be able to differentiate when the system is active, between the pressure of the FSR's on the feet whilst sitting and the change in pressure when about to stand.

Then, start writing.

oric_dan

I don't do java programming, but certainly they must have if..then...else constructs, and comparison operators [=,<,>, etc]. Basically, simple logical operations. Hopefully, these days, they don't bypass basic EE knowledge (of logic) to get to "modern" tools like LabView.

Supposedly, java is so close to C that you can easily understand both language syntaxes. Knowing the former, it should take about 10-minutes to catch on to the latter.

Go Up