Exemple #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)
Exemple #2
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()
#                                                  #
# END   of main loop                               #
#                                                  #
####################################################


def main(dalek_settings, dalek_sounds):
    # pass
    challenge = Challenge(dalek_settings, dalek_sounds)
    challenge.start()
    time.sleep(2)
    # challenge.button_circle_pressed()
    challenge.stop_running()

    # challenge.join() # wait for thread to finish.
    debug.print_to_all_devices("\nFINISHED")
    drive.cleanup()


if __name__ == "__main__":
    # pass
    GPIO.setwarnings(False)
    drive.init()
    debug.debug_on = True
    dalek_settings = settings.Settings()
    dalek_sounds = sound_player.Mp3Player(True)  # initialize the sound player
    main(dalek_settings, dalek_sounds)

else:
    debug.print_to_all_devices('importing slightly_deranged_golf Challenge')