]> defiant.homedns.org Git - ros_wild_thumper.git/blob - scripts/step_response.py
pid fixes
[ros_wild_thumper.git] / scripts / step_response.py
1 #!/usr/bin/env python
2 # -*- coding: iso-8859-15 -*-
3
4 import struct
5 from time import sleep
6 from i2c import i2c_write_reg, i2c_read_reg
7
8
9 def set_pwm(val):
10         i2c_write_reg(0x50, 0x1, struct.pack(">H", val))
11         i2c_write_reg(0x50, 0x3, struct.pack(">H", val))
12         i2c_write_reg(0x50, 0x5, struct.pack(">H", val))
13         i2c_write_reg(0x50, 0x7, struct.pack(">H", val))
14
15 if __name__ == "__main__":
16         set_pwm(210)
17         sleep(3)
18         set_pwm(0)