diff options
| author | abel <abeltimm@protonmail.com> | 2022-10-05 11:32:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-05 11:32:43 +0200 |
| commit | 0a969faa99a81e46106b5b1d9c4bca648c911289 (patch) | |
| tree | b053d93294c3a3d6f2100178c57d735c7832d989 /arduino.ino | |
| parent | a83f59bbd0a67d27c5d159b88c61c0ee82960d49 (diff) | |
| download | robotica-0a969faa99a81e46106b5b1d9c4bca648c911289.tar.gz robotica-0a969faa99a81e46106b5b1d9c4bca648c911289.zip | |
Update arduino.ino
Diffstat (limited to 'arduino.ino')
| -rw-r--r-- | arduino.ino | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arduino.ino b/arduino.ino index 630c286..54fa264 100644 --- a/arduino.ino +++ b/arduino.ino @@ -1,3 +1,20 @@ // https://github.com/Seeed-Studio/Grove_I2C_Motor_Driver_v1_3/archive/master.zip +#include <Grove_I2C_Motor_Driver.h> + +// default I2C address is 0x0f +#define I2C_ADDRESS 0x0f + +void setup() +{ + Motor.begin(I2C_ADDRESS); +} + +// Set the speed of a motor, speed is equal to duty cycle here +void speed(unsigned char motor_id, int _speed); + +delay(1000); + +// Stop one motor +void stop(unsigned char motor_id); |
