I need. Help programming basicstamp2 dagu motodriver
Fieldex
Posts: 7
Hello,
I'm relatively new in he field of electronics, microcontrollers and robotics, i do not have a technical background.
I started with wam and boe bot, and getting more and more interested. The idea is now to build a tracked robot to sent to places i cannot reach with mij wheelchair, i already bought a dagu rover5 and a dagu 4 channel motordriver (because i thought speccially made for each other). And control it with bs2
Learned from my bs excersizes to test all seperate parts of a setup to avoid the needle and haystack phase.
I ended up after testing 3 motors with a fried motordriver bij testing motor 4.
I used in that set up the pulsout command sending it to the pwm pin of the appropiate motorchannel on the driver, as said it worked with 3 motors at motor 4 first some murmer from the motor and smoke from the driver.
Through internet searches found someone, who got the machine running, based on an arduino set-up, and he gave me the following answer and some code used.as follows :
Quote
PWM -> This needs to be connected to a digital output of the arduino, but one that supports PWM modulation. Not all digital outputs support PWM, so you need to be careful here. On an Arduino Duemilanove (ATMEGA328) they are the pins 3 , 5, 6, 10 and 11. On an arduino Mega 2560, they are the pins 2 to 13. Take your board and check for "PWM" beside the pin connectors to know which are supported. Once you've figured which pins to use, in your code, you pass a value between 0 and 255, where 0 is no power and 255 is full power. Example:
#define ENGINE_PIN 3
setup() {
pinMode(ENGINE_PIN, OUTPUT);
}
loop() {
analogWrite(ENGINE_PIN, 128); // Run at half speed.
delay(10000); // Wait 10 seconds.
analogWrite(ENGINE_PIN, 0); // Stop
delay(10000); // Wait 10 seconds.
Unquote
After reading and digging in. Bs2 docs found PWM command and its description, and got even more confused.
It really confuses me, because different proccessor different code-platform, and scared to fry another set up.,
Could anyone tell me, what the pwm-pin does expect, and command in pbasic generates that signal?
Any help much appreciated.
Thanks in advance
Jean
I'm relatively new in he field of electronics, microcontrollers and robotics, i do not have a technical background.
I started with wam and boe bot, and getting more and more interested. The idea is now to build a tracked robot to sent to places i cannot reach with mij wheelchair, i already bought a dagu rover5 and a dagu 4 channel motordriver (because i thought speccially made for each other). And control it with bs2
Learned from my bs excersizes to test all seperate parts of a setup to avoid the needle and haystack phase.
I ended up after testing 3 motors with a fried motordriver bij testing motor 4.
I used in that set up the pulsout command sending it to the pwm pin of the appropiate motorchannel on the driver, as said it worked with 3 motors at motor 4 first some murmer from the motor and smoke from the driver.
Through internet searches found someone, who got the machine running, based on an arduino set-up, and he gave me the following answer and some code used.as follows :
Quote
PWM -> This needs to be connected to a digital output of the arduino, but one that supports PWM modulation. Not all digital outputs support PWM, so you need to be careful here. On an Arduino Duemilanove (ATMEGA328) they are the pins 3 , 5, 6, 10 and 11. On an arduino Mega 2560, they are the pins 2 to 13. Take your board and check for "PWM" beside the pin connectors to know which are supported. Once you've figured which pins to use, in your code, you pass a value between 0 and 255, where 0 is no power and 255 is full power. Example:
#define ENGINE_PIN 3
setup() {
pinMode(ENGINE_PIN, OUTPUT);
}
loop() {
analogWrite(ENGINE_PIN, 128); // Run at half speed.
delay(10000); // Wait 10 seconds.
analogWrite(ENGINE_PIN, 0); // Stop
delay(10000); // Wait 10 seconds.
Unquote
After reading and digging in. Bs2 docs found PWM command and its description, and got even more confused.
It really confuses me, because different proccessor different code-platform, and scared to fry another set up.,
Could anyone tell me, what the pwm-pin does expect, and command in pbasic generates that signal?
Any help much appreciated.
Thanks in advance
Jean
Comments
I was really dissapointed at first, but Obsessed as i am and with some luck after a lot of google time and a lot of reading finally stumbled over the word pwmpall, and came back at parallax. Unfortunately does your dutch agent not suply this particular part, so could you please tell me how i can obtain one.?
Thnks in advance
Jean