Variable-resistance accelerometer