#
# FishPi - An autonomous drop in the ocean
#
# Calibrate ESC through PWM controller
#

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)
    
#!/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)

Example #3
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 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)
Example #4
0
# Simple test of PWM motor and servo drive
#
import logging
import raspberrypi

from time import sleep
from drive_controller import AdafruitDriveController

if __name__ == "__main__":
    logger = logging.getLogger()
    logger.setLevel(logging.DEBUG)
    console = logging.StreamHandler()
    logger.addHandler(console)

    print "testing drive controller..."
    drive = AdafruitDriveController(debug=True, i2c_bus=raspberrypi.i2c_bus())

    print "run ahead..."
    drive.set_throttle(0.5)
    sleep(0.5)
    drive.set_throttle(1.0)
    sleep(0.5)
    drive.set_throttle(0.5)
    sleep(2)

    print "run 0%..."
    drive.set_throttle(-1.0)
    sleep(2)
    drive.set_throttle(0.0)
    sleep(2)
#!/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 "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)
#!/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)