Very simple tracking algorithm - Raspberry Pi Forums
apologies in advance, rubbish @ programming , think i'm being bit thick here, i'm appealing forum inspiration.
have fixed array of 8 pir sensors arranged around compass points, , turret various things on rotated stepper motor. turret should follow people walk past.
@ moment, have simple series of 8 'if' statements, i.e. if north-east pir active, goto 90 degrees. kindof works , has advantage heads latest pir go active, it's not clever, , precise 45 degrees. ideally able find average position based on multiple sensor inputs, dumb programmings techniques involve exponentially large series of 'if' statements.
briefly tried using callbacks functions, 1 each sensor, think ended 8 different threads fighting each other.
can me 'proper' way of doing this?
have fixed array of 8 pir sensors arranged around compass points, , turret various things on rotated stepper motor. turret should follow people walk past.
@ moment, have simple series of 8 'if' statements, i.e. if north-east pir active, goto 90 degrees. kindof works , has advantage heads latest pir go active, it's not clever, , precise 45 degrees. ideally able find average position based on multiple sensor inputs, dumb programmings techniques involve exponentially large series of 'if' statements.
briefly tried using callbacks functions, 1 each sensor, think ended 8 different threads fighting each other.
can me 'proper' way of doing this?
post current code , we'll see if/how can improved.
raspberrypi
Comments
Post a Comment