PicoLowLevel
Loading...
Searching...
No Matches
Motor.h
Go to the documentation of this file.
1#ifndef MOTOR_H
2#define MOTOR_H
3
4#include <Arduino.h>
5#include "definitions.h"
6
10class Motor {
11 public:
12 Motor(byte pwm, byte dir, bool invert = false);
13 void begin();
14 void write(int value);
15
16 private:
17 byte pwm, dir;
18 bool invert;
19};
20
21#endif
Motor class used to control simple DC motors.
Definition Motor.h:10
void begin()
Initialize motors.
Definition Motor.cpp:16
void write(int value)
Sets the motor speed.
Definition Motor.cpp:25