Servo (Arduino Alvik)

Servo (Arduino Alvik)
Extension Description
Control external servo motors connected to Arduino Alvik, set precise angular positions, and adjust servo angles using PictoBlox blocks and Python functions.

Introduction

The Servo (Arduino Alvik) blocks allow users to control external servo motors connected to the robot’s Servo A or Servo B expansion ports. These blocks support both direct angle positioning and relative angle adjustments.

Using these blocks, you can:

  • Set a servo motor to a specified angle.
  • Independently control servos connected to Servo A or Servo B.
  • Increase or decrease the current servo angle.
  • Develop robotic attachments with controlled mechanical movement.

These blocks are useful for building robotic arms, grippers, moving attachments, and other servo-based automation projects.

Alvik Internal Components

Connecting Arduino Alvik with PictoBlox

Before using the Servo (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 moves the servo motor connected to the selected port, Servo A or Servo B, to the specified angular position. It is useful for positioning robotic attachments and controlling mechanical movements.
This block changes the current target angle of the selected servo by the specified number of degrees. Positive values increase the target angle, while negative values decrease it, within the supported movement range of the connected servo.
This block sets the servo motors connected to Servo A and Servo B to their specified angles using a single block. It is useful for coordinating two servo motors in robotic arms, grippers, and other mechanisms that require controlled movement.
This reporter block returns the current angle value of the servo connected to the selected port, Servo A or Servo B. It is useful for checking servo positions, monitoring angle values, and making adjustments based on the previously set position.
All articles loaded
No more articles to load

Python Functions

This function sets the selected servo motor to a specified absolute angle in degrees.
Syntax: set_servo_angle(1, 90)
This function returns the current angle setting of the selected servo motor in degrees.
Syntax: get_servo_angle( )
This function increases or decreases the selected servo motor’s angle by the specified number of degrees. Positive values increase the angle, while negative values decrease it.
Syntax: increase_servo_angle(1, 10)
This function sets the servo motors connected to Servo A and Servo B to independently specified angles using a single command.
Syntax: set_both_servo_angles(90, 90)
This function resets the selected servo motor’s angle setting to the reset value defined by the supported Python implementation.
Syntax: reset_servo_angle(1)
All articles loaded
No more articles to load
Table of Contents