#

import raspberrypi

from time import sleep
from drive_controller import DriveController
from drive_controller import AdafruitDriveController

if __name__ == "__main__":
    print "Calibrating ESC"
    drive = AdafruitDriveController(debug=True, i2c_bus=raspberrypi.i2c_bus())

    raw_input("Power on ESC and enter calibration mode... Then press <ENTER>...")

    print "run full ahead for 5 sec..."
    drive.set_throttle(1.0)
    sleep(5)
    
    print "returning to neutral for 5 sec"
    drive.set_throttle(0.0)
    sleep(5)

    print "run full reverse for 5 sec"
    drive.set_throttle(-1.0)
    sleep(5)
    
    print "returning to neutral"
    drive.set_throttle(0.0)
    sleep(5)

    print "calibration should be complete!"
#!/usr/bin/python

#
# FishPi - An autonomous drop in the ocean
#
# Simple test of PWM motor and servo drive
#

import raspberrypi

from time import sleep
from drive_controller import AdafruitDriveController

if __name__ == "__main__":
    print "stopping drive controller..."
    drive = AdafruitDriveController(debug=True, i2c_bus=raspberrypi.i2c_bus())

    drive.set_throttle(0.0)
    drive.set_steering(0.0)

示例#3
0
# FishPi - An autonomous drop in the ocean
#
# Simple test of PWM motor and servo drive
#

import raspberrypi

from time import sleep
from drive_controller import AdafruitDriveController

if __name__ == "__main__":
    print "testing drive controller..."
    drive = AdafruitDriveController(debug=True, i2c_bus=raspberrypi.i2c_bus())

    print "run full ahead for 5 sec..."
    drive.set_throttle(1.0)
    sleep(5)

    print "run 50% ahead for 5 sec..."
    drive.set_throttle(0.5)
    sleep(5)

    print "run 0% for 5 sec..."
    drive.set_throttle(0.0)
    sleep(5)

    print "run 50% reverse for 5 sec"
    drive.set_throttle(-0.5)
    sleep(5)

    print "run full reverse for 5 sec"
# FishPi - An autonomous drop in the ocean
#
# Simple test of PWM motor and servo drive
#

import raspberrypi

from time import sleep
from drive_controller import AdafruitDriveController

if __name__ == "__main__":
    print "testing drive controller..."
    drive = AdafruitDriveController(debug=True, i2c_bus=raspberrypi.i2c_bus())

    print "run full ahead for 5 sec..."
    drive.set_throttle(1.0)
    sleep(5)
    
    print "run 50% ahead for 5 sec..."
    drive.set_throttle(0.5)
    sleep(5)

    print "run 0% for 5 sec..."
    drive.set_throttle(0.0)
    sleep(5)

    print "run 50% reverse for 5 sec"
    drive.set_throttle(-0.5)
    sleep(5)
    
    print "run full reverse for 5 sec"
示例#5
0
#!/usr/bin/python

#
# FishPi - An autonomous drop in the ocean
#
# Simple test of PWM motor and servo drive
#

import raspberrypi

from time import sleep
from datetime import datetime
from drive_controller import AdafruitDriveController

if __name__ == "__main__":
    print "testing drive controller..."
    drive = AdafruitDriveController(debug=True, i2c_bus=raspberrypi.i2c_bus())

    print "run full ahead..."
    drive.set_throttle(1.0)

    while True:
        with open('/home/fishpi/logs/long_test.txt', 'w') as f:
            f.write(datetime.now().isoformat())
            f.write('\r\n')
        sleep(5)
   
import raspberrypi

from time import sleep
from drive_controller import DriveController
from drive_controller import AdafruitDriveController

if __name__ == "__main__":
    print "Calibrating ESC"
    drive = AdafruitDriveController(debug=True, i2c_bus=raspberrypi.i2c_bus())

    raw_input(
        "Power on ESC and enter calibration mode... Then press <ENTER>...")

    print "run full ahead for 5 sec..."
    drive.set_throttle(1.0)
    sleep(5)

    print "returning to neutral for 5 sec"
    drive.set_throttle(0.0)
    sleep(5)

    print "run full reverse for 5 sec"
    drive.set_throttle(-1.0)
    sleep(5)

    print "returning to neutral"
    drive.set_throttle(0.0)
    sleep(5)

    print "calibration should be complete!"