topikachu / python-ev3

a project to run lego ev3 in python
Apache License 2.0
189 stars 73 forks source link

Reset Sensor value? #57

Closed maxnoe closed 9 years ago

maxnoe commented 9 years ago

Is it possible to reset (or set) a sensor value?

I would like to null the gyro at program start and maybe several times in the program.

dlech commented 9 years ago

It depends on the sensor. For example, the LEGO EV3 Gyro sensor can be reset by momentarily changing to a different mode and then changing back to the desired mode. Most of the other gyro sensors out there don't have a reset function. You just have to maintain an offset variable in your program and use that to "zero" the sensor value.

maxnoe commented 9 years ago

Ah, ok thanks. I was talking about the LEGO Sensor.I thought i could avoid keeping track of the sensor value at certain positions.