I need help coding a project I was i the process of making. Its a remote controlled puppet on a tricycle. The servo I had for it I guess no longer works so now I only have the motor, receiver, transmitter and I need to code it for those only. Please someone help, this is a halloween project
Hello mommy2one
Post your current sketch, well formated, with well-tempered comments and in so called code tags "< code >" and a schematic to see how we can help.
// Controller pins
const int CH_2_PIN = 3;
// Motor driver pins
const int STBY_PIN = 7;
const int AIN1_PIN = 12;
const int AIN2_PIN = 11;
const int APWM_PIN = 10;
const int BPWM_PIN = 5;
// Parameters
const int deadzone = 40; // Anything between -40 and 40 is stop
void setup()
{
// Configure pins
pinMode(STBY_PIN, OUTPUT);
pinMode(AIN1_PIN, OUTPUT);
pinMode(AIN2_PIN, OUTPUT);
pinMode(APWM_PIN, OUTPUT);
// Enable motor driver
digitalWrite(STBY_PIN, HIGH);
}
void loop()
{
// Limit speed between -255 and 255
analogWrite(APWM_PIN, 250);
// Test motor A
delay(500);
digitalWrite(AIN1_PIN, HIGH); //fwd
digitalWrite(AIN2_PIN, LOW);
delay(1500);
digitalWrite(AIN1_PIN, LOW); //stop
digitalWrite(AIN2_PIN, LOW);
delay(500);
digitalWrite(AIN1_PIN, LOW); //rev
digitalWrite(AIN2_PIN, HIGH);
delay(1500);
digitalWrite(AIN1_PIN, LOW); //stop
digitalWrite(AIN2_PIN, LOW);
delay(500);
}
That is the current code Im using when I had the servo
Images of what I have hooked up and the image created of how its hooked up
Your other thread on this topic seems unfinished...
No one was responding and that was from over a week ago, plus I started a new topic because it dont have anything to do with the servo anymore.
I see. There is a lot of information on the other thread that would need to be re-told here. I would use that other thread and update what you have accomplished... removing a servo, posting current sketch... all the good stuff. The activity of posting will put it at the top of "Latest" that everyone sees. Your choice.
I posted on the other thread so I will just delete this one
A personal hint: Asking for help is redundant information. The need for help is implied in a good topic.
Now, if your nickname in anyway reflects the real you, you have my admiration. If your kid is old enough to be a part of this, it's a great activity to bond to and have fun.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.





