Exemplo n.º 1
0
def main():
    # '''
    # This is only run if you run the file directly
    #'''

    GPIO.setmode(
        GPIO.BOARD)  # Set the GPIO pins as numbering - Also set in drive.py
    GPIO.setwarnings(False)
    drive.init()
    spi.init()
    dalek_settings = settings.Settings()
    dalek_settings.slow_mode()

    dalek_settings
    # try:
    start(dalek_settings)
Exemplo n.º 2
0
def setup():  # Setup GPIO and initialize Imports

    debug.turn_debug_on()  # use the debug and turn on output
    # if left empty then default is just stout
    debug.set_output_device("scrollphat")

    dalek_sounds.set_volume_level(-5)  # values: -20 to 10
    dalek_sounds.play_sound("Beginning")  # annoy someone

    # Set the GPIO pins as numbering - Also set in drive.py
    GPIO.setmode(GPIO.BOARD)
    # Turn GPIO warnings off - CAN ALSO BE Set in drive.py
    GPIO.setwarnings(False)

    drive.init()  # Initialise the software to control the motors
    spi.init()  # Initialise my software for the MOSI/spi Bus
    controller.init()  # Initialise the controller
Exemplo n.º 3
0
def main():
    '''
    This is only run if you run the file directly
    '''
    GPIO.setmode(
        GPIO.BOARD)  # Set the GPIO pins as numbering - Also set in drive.py
    GPIO.setwarnings(False)
    spi.init()
    dalek_settings = settings.Settings()
    dalek_settings.slow_mode()
    drive.init()
    dalek_sounds = sound_player.Mp3Player(True)  # initialize the sound player
    debug.debug_on = True
    debug.print_to_all_devices("working", "OK")
    try:
        straight_line_speed_test(dalek_settings, dalek_sounds)
        time.sleep(1)
    except:
        print("!!! error")
        drive.cleanup()
Exemplo n.º 4
0
    import sys
    from os import path
    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
    import RPi.GPIO as GPIO  # Import GPIO divers

    GPIO.setwarnings(False)


#!/usr/bin/env python3
import time
from dalek import spi
from dalek import drive
from dalek import debug
from dalek import head_controller

drive.init()

# this is the default distance the bot drives to the wall.
distance_to_wall = 15

# when these are used in challenges they are used relative to the start position.
compass_positions = {'forward': -1, 'right': -1, 'left': -1, 'backwards': -1}


# start the sensor service.
DalekSensors = spi.SensorData()
DalekSensors.start()


def turn_right_90_deg_with_sonic():
    turnspeed = 50
Exemplo n.º 5
0
                        rightPaddle = int(value / 327.67)
                        tank_drive(leftPaddle, rightPaddle)

    # we have finished so clean up
    jsdev.close()


def main(dalek_settings, dalek_sounds):
    init()
    use(dalek_settings, dalek_sounds)
    drive.cleanup()


if __name__ == "__main__":
    debug.debug_on = True
    dalek_settings = settings.Settings()
    dalek_sounds = sound_player.Mp3Player(True)  # initialize the sound player

    debug.turn_debug_on()  # use the debug and turn on output
    # if left empty then default is just stout
    debug.set_output_device("scrollphat")

    # Set the GPIO pins as numbering - Also set in drive.py
    GPIO.setmode(GPIO.BOARD)
    # Turn GPIO warnings off - CAN ALSO BE Set in drive.py
    GPIO.setwarnings(False)

    drive.init()  # Initialise the software to control the motors
    spi.init()
    main(dalek_settings, dalek_sounds)