This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
BTS 7960B | |
*/ | |
int RPWM1 = 5; // Two board used here, 1 | |
int LPWM1 = 6; | |
int L_EN1 = 7; | |
int R_EN1 = 8; | |
int RPWM2 = 9; // and 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int AIA = 3; | |
const int AIB = 4; | |
const int BIA = 5; // If you have the dual driver remove | |
const int BIB = 6; // the comments and enable the other engine | |
byte speed = 255; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(AIA, OUTPUT); | |
pinMode(AIB, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HALF STEP | |
#define stepper PORTB | |
#define waiting_time 500 | |
void setup() { | |
for (int z = 8; z < 12; z++) { | |
pinMode(z, OUTPUT); // pins 8,9,10,11 output for driving the motor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Full Step | |
#define stepper PORTB | |
#define waiting_time 500 | |
void setup() { | |
for (int z = 8; z < 12; z++) { // FULL STEP DRIVE | |
pinMode(z, OUTPUT); // pins 8,9,10,11 output for driving the motor | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WAVE DRIVE | |
#define stepper PORTB | |
#define waiting_time 500 | |
void setup() { | |
for (int z = 8; z < 12; z++) { | |
pinMode(z, OUTPUT); // pins 8,9,10,11 output for driving the motor | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define control1 8 // pin that controls the MOSFET | |
#define control2 9 // pin that controls the MOSFET | |
void setup() { | |
pinMode(control1, OUTPUT); // define control pin as output | |
pinMode(control2, OUTPUT); // define control pin as output | |
Serial.begin(9600); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define control 8 // pin that controls the MOSFET | |
void setup() { | |
// IRF520 MOSFET | |
pinMode(control, OUTPUT); // define control pin as output | |
Serial.begin(9600); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Adafruit v1 */ | |
#include <AFMotor.h> //Include library AF Motor | |
AF_DCMotor motor3(3); // Motor 1 Selected | |
AF_DCMotor motor4(4); // Motor 1 Selected | |
unsigned char velocidade1 = 0x00; // Storage motor1 Speed (8 bits) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Adafruit v2 */ | |
#include <Wire.h> | |
#include <Adafruit_MotorShield.h> | |
#include "utility/Adafruit_MS_PWMServoDriver.h" | |
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); | |
Adafruit_DCMotor *frontMotor = AFMS.getMotor(3); | |
Adafruit_DCMotor *backMotor = AFMS.getMotor(4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <AFMotor.h> //Include library AF Motor | |
AF_DCMotor motor1(1); // Motor 1 Selected | |
unsigned char velocidade1 = 0x00; // Storage motor1 Speed (8 bits) | |