X-Git-Url: https://defiant.homedns.org/gitweb/?p=ros_wild_thumper.git;a=blobdiff_plain;f=scripts%2Fstep_response.py;fp=scripts%2Fstep_response.py;h=9f74ab98daa8b61cc0c81e5ed0919d6e3ac4e56d;hp=0000000000000000000000000000000000000000;hb=126edeb2696bb7635a9607b5d6bac8e21a4507c1;hpb=9600299d1815cb14a3f49c72c4266adc1f471bcb diff --git a/scripts/step_response.py b/scripts/step_response.py new file mode 100755 index 0000000..9f74ab9 --- /dev/null +++ b/scripts/step_response.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# -*- coding: iso-8859-15 -*- + +import struct +from time import sleep +from i2c import i2c_write_reg, i2c_read_reg + + +def set_pwm(val): + i2c_write_reg(0x50, 0x1, struct.pack(">H", val)) + i2c_write_reg(0x50, 0x3, struct.pack(">H", val)) + i2c_write_reg(0x50, 0x5, struct.pack(">H", val)) + i2c_write_reg(0x50, 0x7, struct.pack(">H", val)) + +if __name__ == "__main__": + set_pwm(210) + sleep(3) + set_pwm(0)