roboapi package¶
roboapi¶
API for Atmega 2560 based robot control
-
class
roboapi.Atmega(baudrate=9600)[source]¶ Bases:
objectA Parent class for I/O port access
-
classmethod
check_for_valid_pin_port(portname, pin_value)[source]¶ Check for valid pin numbers and port numbers raises Value Error if invalid
- Parameters:
- 1.portname: str
- Port Name given by the user
- 2.pin_value: integer
- binary wieghted decimal representation of the pin numbers given by the user
-
classmethod
config_register(Registername, Pins=[], set_pins=None)[source]¶ - Accessing I/O ports of the controller
- Sends a serial packet to the controller based on the input arguments
- Parameters:
- 1.Registername = str
- Name of the I/O Port
- 2.Pins = list
- A comma separated list of I/O pin numbers
- 3.set_pins = Named Argument
- The corresponding pin numbers set to logic ‘1’ when True; set to logic ‘0’ when False
- Examples:
- Port J access
>>> config_register('PortJ', Pins=[1, 2, 4], set_pins=True)
- Port A access
>>> config_register('DDRA', Pins=[0,5,3,5], set_pins=False)
-
classmethod
-
class
roboapi.Buzzer(baudrate)[source]¶ Bases:
roboapi.AtmegaDerived class from parent class Atmega. Provides functions to control Buzzer
-
class
roboapi.Motion(baudrate)[source]¶ Bases:
roboapi.AtmegaDerived class to control the motion of the robot
- Description:
- DC motors controlled by PortL pins 3,4 and PortA pins 0,1,2,3
serial_connection¶
-
serial_connection.serial_open(baudrate)[source]¶ Searches all serially connected devices. List all devices recognized as ttyUSB* (for Linux)
-
serial_connection.serial_port_connection(port_detect)[source]¶ Function: Multiple serial devices may be connected to system. This function list down all connected serial ports and ask user to select a desired port
Parameters:
- 1.port_detect = list
- list of all serial ports detected
- 2.baudrate = Named Argument
- Baudrate for serial communication