-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRASelectrical.txt
More file actions
66 lines (41 loc) · 1.74 KB
/
RASelectrical.txt
File metadata and controls
66 lines (41 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Part number => Pololu md08a 0J7305
Link : https://www.pololu.com/product/713
Datasheet : https://www.pololu.com/file/0J86/TB6612FNG.pdf
^THIS IS THE DATA SHEET FOR JUST THE IC, NOT THE BOARD.
Pinout : https://www.pololu.com/file/0J648/TB6612FNG-dual-motor-driver-carrier-schematic-diagram.pdf
^REFER TO PIN OUT DIAGRAM TO SEE WHICH PIN ON THE IC ARE SHORTED TO WHICH PIN ON THE BOARD.
Notes:
IN1 --> HIGH
IN2 --> LOW
PWM SIGNAL
STBY --> HIGH
Motor link: https://www.pololu.com/product/3051
Datasheet: https://www.pololu.com/file/0J1487/pololu-micro-metal-gearmotors-rev-4-1.pdf
From the website description, you can use visual cues to differentiate between the motor types and which one is the 12 or 6 volt.
Supply 5V from Arduino to pin VMOT
Connect one terminal (doesn't matter which) of the motor to pin AO1
Connect the other terminal to PIN A02
----------------------------ARDUINO CODE-------------------------
int AIN1 = 4; //connect pin AIN1 on the board to pin4.
int AIN2 = 8; //connect pin AIN2 on the board to pin4.
int PWMA = 10; //connect to pin 10
int STBY = 2; //connect to pin2
void setup() {
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMA, OUTPUT);
pinMode(STBY, OUTPUT);
//setting direction of motor (two lines below this)
digitalWrite(AIN1, HIGH); //writing digital high to pin AIN1
digitalWrite(AIN2, LOW); //wirint ditial low to pin AIN2
//to flip direction of rotation, writing HIGH to pin AIN2 and LOW to
//AIN1 should do the trick.
digitalWrite(STBY, HIGH); //Writing high to standby pin
}
void loop() {
digitalWrite(PWMA, HIGH); //turn motor on
delay(5000); //for 5 seconds
digitalWrite(PWMA, LOW); //turn motor off
delay(5000); //for 5 seconds.
//NEXT STEPS, VARIBALE SPEED?
}