Alex Glow
Published © CC BY

First Steps with the Arduino Alvik Robot Kit

Getting started with the Arduino robotics platform for beginners!

BeginnerProtip1 hour1,097
First Steps with the Arduino Alvik Robot Kit

Things used in this project

Hardware components

Arduino Alvik
Arduino Alvik
×1

Software apps and online services

Arduino Lab for MicroPython

Story

Read more

Schematics

Components (top of kit)

From the user manual at https://docs.arduino.cc/tutorials/alvik/user-manual

Components (bottom of kit)

From the user manual at https://docs.arduino.cc/tutorials/alvik/user-manual

Arduino Nano ESP32 pinout diagram

From the manual page

Code

Alvik demo code

MicroPython
The built-in MicroPython code when you get the kit.
from arduino_alvik import ArduinoAlvik
from time import sleep_ms
import sys

alvik = ArduinoAlvik()
alvik.begin()

menu_status = 0


def update_led_status(val):
    if val == 0:
        alvik.left_led.set_color(0, 0, 1)
        alvik.right_led.set_color(0, 0, 1)
    elif val == 1:
        alvik.left_led.set_color(0, 1, 0)
        alvik.right_led.set_color(0, 1, 0)
    elif val == -1:
        alvik.left_led.set_color(1, 0, 0)
        alvik.right_led.set_color(1, 0, 0)


while True:

    update_led_status(menu_status)

    try:

        if alvik.get_touch_ok():
            if menu_status == 0:
                import line_follower
            elif menu_status == 1:
                import hand_follower
            elif menu_status == -1:
                import touch_move

        if alvik.get_touch_up() and menu_status < 1:
            menu_status += 1
            update_led_status(menu_status)
            while alvik.get_touch_up():
                sleep_ms(100)
        if alvik.get_touch_down() and menu_status > -1:
            menu_status -= 1
            update_led_status(menu_status)
            while alvik.get_touch_down():
                sleep_ms(100)

        sleep_ms(100)

    except KeyboardInterrupt as e:
        print('over')
        alvik.stop()
        sys.exit()

Credits

Alex Glow

Alex Glow

149 projects • 1587 followers
The Hackster team's resident Hardware Nerd. I love robots, music, EEG, wearables, and languages. FIRST Robotics kid.

Comments