]> defiant.homedns.org Git - ros_wild_thumper.git/blob - step_response.py
9f74ab98daa8b61cc0c81e5ed0919d6e3ac4e56d
[ros_wild_thumper.git] / 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)