This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc usb.c `pkg-config --libs --cflags libusb-1.0 | |
#include <errno.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <libusb.h> | |
static struct libusb_device_handle *devh = NULL; | |
static int open_device(void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uart | |
def py_bot(): | |
s = uart.writeLine | |
s("\x01") # raw mode | |
s("""r.println("Hello from NW !") | |
utime.sleep(5) | |
while True: | |
r.motor_speed(50, 50) | |
while r.distance_in_cm() > 30: | |
utime.sleep(.01) |