""" Auteur: Yohan Chalier Interface: microbit Nom du projet: Robot télécommandé : Robot Description: No-description Toolbox: vittascience Mode: mixed Blocks: ordre76320ordreEQordre1GAUCHE0x000x11000x020x0100FALSEFALSETRUEFALSEFALSEFALSETRUEFALSEFALSEFALSETRUETRUETRUETRUETRUEFALSETRUEFALSEFALSEFALSEFALSEFALSETRUEFALSEFALSEEQordre1DROITE0x000x01000x020x1100FALSEFALSETRUEFALSEFALSEFALSEFALSEFALSETRUEFALSETRUETRUETRUETRUETRUEFALSEFALSEFALSETRUEFALSEFALSEFALSETRUEFALSEFALSEEQordre1STOP0x000x000x020x00TRUEFALSEFALSEFALSETRUEFALSETRUEFALSETRUEFALSEFALSEFALSETRUEFALSEFALSEFALSETRUEFALSETRUEFALSETRUEFALSEFALSEFALSETRUEEQordre1AVANCE0x000x02000x020x0200FALSEFALSETRUEFALSEFALSEFALSETRUETRUETRUEFALSETRUEFALSETRUEFALSETRUEFALSEFALSETRUEFALSEFALSEFALSEFALSETRUEFALSEFALSE Projet généré par Vittascience. Ce fichier contient le code textuel ainsi que le code blocs. Il peut être importé de nouveau sur l'interface http://vittascience.com/microbit/ """ from microbit import * import radio """ Maqueen robot """ radio.on() radio.config(channel = 7, power = 6, length = 32, group=0) while True: ordre = radio.receive() if ordre: if ordre == 'GAUCHE': i2c.write(0x10, bytearray([0x00, 0x1, 100])) i2c.write(0x10, bytearray([0x02, 0x0, 100])) led_image = Image('00900:09000:99999:09000:00900') display.show(led_image) elif ordre == 'DROITE': i2c.write(0x10, bytearray([0x00, 0x0, 100])) i2c.write(0x10, bytearray([0x02, 0x1, 100])) led_image = Image('00900:00090:99999:00090:00900') display.show(led_image) elif ordre == 'STOP': i2c.write(0x10, bytearray([0x00, 0x0, 0])) i2c.write(0x10, bytearray([0x02, 0x0, 0])) led_image = Image('90009:09090:00900:09090:90009') display.show(led_image) elif ordre == 'AVANCE': i2c.write(0x10, bytearray([0x00, 0x0, 200])) i2c.write(0x10, bytearray([0x02, 0x0, 200])) led_image = Image('00900:09990:90909:00900:00900') display.show(led_image)