L298n.Driver (L298N v0.1.0)
View SourceGenServer process for managing L298N motor driver hardware interface.
This module handles the low-level GPIO interactions with the L298N chip, including PWM control for speed and digital pins for direction control.
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets current motor speeds.
Sets the speed for motor A only.
Sets the speed for motor B only.
Sets the speed and direction for both motors.
Starts the L298N driver GenServer.
Stops all motors.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Gets current motor speeds.
Sets the speed for motor A only.
Sets the speed for motor B only.
Sets the speed and direction for both motors.
Parameters
motor_a_percent- Speed for motor A (-100 to 100)motor_b_percent- Speed for motor B (-100 to 100)
Starts the L298N driver GenServer.
Parameters
opts- Keyword list with motor configurations
Options
:motor_a- Map with:in1,:in2,:enpin numbers for motor A:motor_b- Map with:in1,:in2,:enpin numbers for motor B:name- Process name (defaults to__MODULE__)
Stops all motors.