Motors (Arduino Alvik)

Motors (Arduino Alvik)
Extension Description
Control Arduino Alvik’s left and right wheel motors independently, adjust motor speed and power, and monitor wheel rotation using PictoBlox blocks and Python functions.

Introduction

The Motors (Arduino Alvik) blocks allow users to control the robot’s two drive motors individually. They provide options for controlling motor direction, speed, power, and rotation while reading feedback from the built-in wheel encoders.

Using these blocks, you can:

  • Run the left or right motor independently.
  • Control motor speed using percentages or RPM.
  • Run motors for specified durations.
  • Set different speeds or power levels for both wheels.
  • Read motor RPM and rotation angles.
  • Reset motor rotation measurements.

These blocks are useful for learning motor control, wheel encoders, differential-drive robotics, and movement automation.

Alvik Internal Components

Connecting Arduino Alvik with PictoBlox

Before using the Motors (Arduino Alvik) blocks, connect your robot to PictoBlox using USB or Bluetooth.

Follow the step-by-step instructions in the Arduino Alvik Connection Guide.

CTR of Arduino Alvik Connection Guide

Read More

PictoBlox Blocks

This block runs the selected motor in the specified direction at the given percentage speed. It allows independent control of the left or right motor.
This block runs the selected motor at the specified speed and direction for a defined duration. The motor stops when the selected time is complete.
This block controls the selected motor at a specified rotational speed, measured in revolutions per minute (RPM). It is useful for applications that require controlled wheel rotation.
This block runs the selected motor at the specified RPM for a defined duration before stopping it.
This block independently sets the power percentage supplied to each wheel motor. It is useful for experimenting with differential-drive movement and direct motor-power control.
This reporter block returns the current rotational speed of the selected motor in RPM using wheel encoder feedback.
This reporter block returns the accumulated rotation angle of the selected motor in degrees. It uses wheel encoder measurements to track how far the motor has rotated.
This block resets the stored rotation measurement and associated tracking information for the selected motor. It is useful before beginning a new wheel-rotation measurement.
This block sets separate RPM values for the left and right motors. It allows the wheels to rotate at different speeds for controlled turning and movement.
All articles loaded
No more articles to load

Python Functions

This function runs the selected motor at the specified speed and direction.
Syntax: runWheel(1, 1, 100)
This function runs the selected motor at the given speed and direction for a specified duration in seconds.
Syntax: runWheelTimed(1, 1, 100, 1)
This function controls the selected motor at the specified rotational speed in RPM.
Syntax: run_wheel_rpm(1, 1, 50)
This function runs the selected motor at the specified RPM for a defined duration.
Syntax: run_wheel_rpm_timed(1, 1, 50, 1)
This function independently sets the RPM targets of the left and right motors.
Syntax: set_wheels_rpm(50, 50)
This function sets separate motor-power percentages for the left and right motors.
Syntax: set_wheels_power(50, 50)
This function returns the current rotational speed of the selected motor in RPM.
Syntax: get_wheel_speed(1)
This function returns the accumulated rotation angle of the selected motor in degrees.
Syntax: get_wheel_angle(1)
This function resets the rotation measurement of the selected wheel motor.
Syntax: reset_wheel(1)
All articles loaded
No more articles to load
Table of Contents