alextaujenis / rbd_motor Goto Github PK
View Code? Open in Web Editor NEWArduino Motor Library - Control many motors.
Home Page: https://robotsbigdata.com/docs-arduino-motor.html
License: MIT License
Arduino Motor Library - Control many motors.
Home Page: https://robotsbigdata.com/docs-arduino-motor.html
License: MIT License
for an installation i need the ramp function and arduino-audtio-tools sd-a2dp-player in one sketch. if i do so, with player active, no ramp anymore possible. i need a slow ramp up over 5sec or more when the player starts, slow down when the player stops . something interferes there. how could i get to the core of the problem? where to look? i am not a real programmer...but experimentalist
yann
hello, i use the rbd lib to slowly ramp up and down the motor in an art installation..that all works very well...the motor start to spin for a time on a button pressed and then slows and stops.. the installation has sound as well. the sound shall also fade (ramp) in and out but faster than the motor. could i use and instance of this lib also for send a number to an external device, not pwm, to set its volume?
greets
yann
I'm using an H-bridge motor controller that has only 2 input pins: in1 is a PWM-capable Enable pin, and in2 is a High/Low Direction pin. How should I define the Motor Constructor so that forward() sets HIGH on the pin going to in2, and reverse() sets LOW on that same pin? (I don't have two separate direction pins on my controller)
Currently I'm just using motor.on() and manually setting the direction pin before I turn it on like the code below, but I was hoping there might be a way to better utilize the library.
// Arduino RBD Motor Library v2.1.2 Example - Spin a motor up and down with events.
// https://github.com/alextaujenis/RBD_Motor
// Copyright (c) 2015 Alex Taujenis - MIT License
#include <RBD_Timer.h> // https://github.com/alextaujenis/RBD_Timer
#include <RBD_Motor.h> // https://github.com/alextaujenis/RBD_Motor
RBD::Motor motor(6); // pwm pin
const int DCdirection = 7;
void setup() {
motor.rampUp(3000);
}
void loop() {
motor.update();
if(DCdirection == HIGH){
DCdirection = LOW;
}
else{
DCdirection = HIGH;
}
if(motor.onTargetSpeed()) {
if(motor.isOn()) {
motor.rampDown(300);
}
else {
motor.rampUp(300);
}
}
}
Thanks for creating and sharing your suite of libraries.
Is it possible to use this library to control an H-bridge that only has two pins? So instead of a PWM pin, and forward + reverse pins, only have two PWM pins. For example, if you wanted to move the motor forward, you would set the forward PWM pin to a non-zero value, and the reverse PWM pin to 0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.