BT connection improved. Requstes to enable BT. 5 speed implementation.
UI improvements
This commit is contained in:
34
Arduino/motor_test/motor_test.ino
Normal file
34
Arduino/motor_test/motor_test.ino
Normal file
@ -0,0 +1,34 @@
|
||||
#include <SparkFun_TB6612.h>
|
||||
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
#define AIN1 4
|
||||
#define BIN1 8
|
||||
#define AIN2 5
|
||||
#define BIN2 7
|
||||
#define PWMA 11
|
||||
#define PWMB 10
|
||||
#define STBY 6
|
||||
|
||||
const int offsetA = 1;
|
||||
const int offsetB = -1;
|
||||
|
||||
Motor motor1 = Motor(AIN1, AIN2, PWMA, offsetA, STBY);
|
||||
Motor motor2 = Motor(BIN1, BIN2, PWMB, offsetB, STBY);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
Serial.println("Ready:");
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
int v = 0;
|
||||
while(v<=255) {
|
||||
motor2.drive(v);
|
||||
Serial.println("Speed: "+String(v));
|
||||
delay(100);
|
||||
v = v+1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user