Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Can't decide how to deal with the maffs in this proximity detector thingie.
Tricky.
Doing a moving average of 16 values using an array, which smooths out a certain amount of crapola.
Naturally I'm using a PIC, so ram is constrained to not very much.
And ints are 16 bits.
What I want to do is a running moving average sort of thingie that gives me a decent baseline so I can subract it from the moving average above to give a nice value wot starts at about zero ish and goes up to about 0x4d ish.
Hinspiration is sadly lacking at the moment.
It gives a measurement value roughly every 500 to 1200us depending on the proximity of one's mit to the sensor.
When your mit is absent, it's 500us, and when your sticky mit is on the pad, it's about 1200us.
There's sommat on the tip of my tongue but it just isn't gelling at the moment.
Ho hum.
so near but yet so far.
I think I'll make the pcb tomorrow, perhaps that'll give me some inspiration.
Comment