简体   繁体   English

中断和电机直流引脚的问题 - Arduino UNO

[英]Problems with pins for interruption and motor DC - Arduino UNO

I am working in a project which requires me to read the velocity of a DC motor with a quadrature encoder.我正在一个项目中工作,该项目要求我使用正交编码器读取直流电机的速度。 I am using the Arduino UNO board and for some weird reason the motor just works if it is connected to the pins 2 and 3. However this pins are reserved for the interruption (where I intended to connect the encoder).我正在使用 Arduino UNO 板,出于某种奇怪的原因,如果电机连接到引脚 2 和 3,它就可以工作。但是,这些引脚是为中断保留的(我打算连接编码器的地方)。 How could I solve this problem?我怎么能解决这个问题?

Assuming the arduino can provide enough current, you should be able to run the motor from any output pin, check out this diagram for reference.假设 arduino 可以提供足够的电流,您应该能够从任何输出引脚运行电机,请查看 此图以供参考。 You should also make sure you have the necessary protection circuits in place.您还应该确保安装了必要的保护电路。 This is a good starting point: https://create.arduino.cc/projecthub/licensedGeek/controlling-a-dc-motor-from-an-arduino-101-board-f4954b这是一个很好的起点: https : //create.arduino.cc/projecthub/licensedGeek/controlling-a-dc-motor-from-an-arduino-101-board-f4954b

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM