Difference between revisions of "BPI-Nano robot 机器人扩展板"
(Created page with " =Overview= thumb|arduino Nano robot board thumb| BPI-Nano arduino Nano File:BPI-Nano_robort_4.JPG|thumb| B...") |
|||
Line 9: | Line 9: | ||
[[File:ESP32_6.JPG|thumb|[[BPI-UNO32]] with ESP32]] | [[File:ESP32_6.JPG|thumb|[[BPI-UNO32]] with ESP32]] | ||
− | + | BPI-Nano robot 机器人扩展板是为ardino nano板与arduino Nano兼容板设计. 由[https://www.facebook.com/harsh.dethe.5602 '''Harsh Dethe''']设计,由[http://wiki.banana-pi.org/About_BPI '''比派科技''']生产。 | |
− | BPI- | + | BPI-NANO robot 控制器可用的电机驱动扩展板,支持双路电机控制,单路最大电流可达1A. |
− | + | Arduino标准插针设计接口,也可给Arduino Nano配合使用。可应用于小型移动机器人的开发。 | |
=Hardware= | =Hardware= |
Revision as of 18:58, 9 October 2019
Contents
Overview
BPI-Nano robot 机器人扩展板是为ardino nano板与arduino Nano兼容板设计. 由Harsh Dethe设计,由比派科技生产。
BPI-NANO robot 控制器可用的电机驱动扩展板,支持双路电机控制,单路最大电流可达1A.
Arduino标准插针设计接口,也可给Arduino Nano配合使用。可应用于小型移动机器人的开发。
Hardware
Technical specifications
- Driver chip: L293B
- Logical working voltage: 5V DC
- Motor drive voltage: 7-12v DC
- Maximum driving current: 1A (per circuit)
- Pin for motor drive: pin4/5/6/7 (Arduino controller)
- Size: 56x57mm
Hardware interface
PIN define
BPI-Nano aruino Nano robort GPIO pin define | |||
Pin | Function | ||
Digital 2、4 | Motor2 Steering control, 2 high level, 4 low level positive turn;Whereas inversion | ||
Digital 3 | Motor 2 Enable interface, high level enable | ||
Digital 5 | Motor 1 Enable interface, high level enable | ||
Digital 7、8 | Motor 1 Steering control, 7 high level, 8 low level positive turn;Whereas inversion |
Software
Sample code
//This motor shield use Pin 2,3,4,5,6,7,8 to control the motor // Just plug the nano into the shield // Simply connect your motors to M1 ,M2 // Upload the code to BPI-NANO/arduino // Through serial monitor, type 'a','s', 'w','d','x' to control the motor // http://www.banana-pi.org/ // http://www.banana-pi.org/ // Last modified on 20/09/2019 int EN1 = 5; //Motor 1 Enable int EN2 = 3; //Motor 2 Enable int IN1 = 7; int IN2 = 8; //Motor 1 int IN3 = 2; int IN4 = 4; //Motor 2 void Motor1(int ENA, boolean reverse) { digitalWrite(ENA,HIGH); if(reverse) { digitalWrite(IN1,HIGH); digitalWrite(IN2,LOW); } else { digitalWrite(IN1,LOW); digitalWrite(IN1,HIGH); } } void Motor2(int ENB, boolean reverse) { digitalWrite(ENB,HIGH); if(reverse) { digitalWrite(IN3,HIGH); digitalWrite(IN4,LOW); } else { digitalWrite(IN3,LOW); digitalWrite(IN4,HIGH); } } void setup() { int i; for(i=2;i<=8;i++) //For BPI-NANO Motor Shield pinMode(i, OUTPUT); //set pin 2,3,4,5,6,78 to output mode Serial.begin(9600); } void loop() { int x,delay_en; char val; while(1) { val = Serial.read(); if(val!=-1) { switch(val) { case 'w'://Move ahead Motor1(100,true); Motor2(100,true); break; case 's'://move back Motor1(100,false); Motor2(100,false); break; case 'a'://turn left Motor1(100,true); Motor2(100,false); break; case 'd'://turn right Motor1(100,false); Motor2(100,true); break; case 'x'://stop digitalWrite(ENA,LOW); digitalWrite(ENB,LOW); break; } } } }