Need help geting a sketch

hello ive been all over the web looking for a sketch for my tank and use wifi i have arduino uno wifi r4 and arduino motor sheild r3 I can't figure out how to do one myself lol im geting frustrated with it can anyone help me out ?

Welcome! That sounds like an interesting project that could be a lot of fun!

Normally when doing a project the last thing we do is purchase the parts. In your case you have parts looking for a design.

There are several things. You can get lucky and find it. There is also a for hire section if you want to pay for it. there is a section for that. You can do it yourself.

I recommend you start by getting a copy of the Arduino Cookbook and go through it. Do any of the projects that interest you.

After you finish that you will have a good idea of what you can do and how to find sections of code to do your project with. You may have to do like most of us use sections from different programs and put them together in such a way it does what we want.

However, please keep in mind that we are not a free design or code-writing service. We’re more than happy to help with your design or code, but we need you to make an initial attempt. Please design and write your code, then post it along with an explanation of what’s not working properly.

As you progress ask and we will help you. Your project is very difficult unless you have some background in coding and electronics.

  1. Show Your Work First: Before asking for assistance, make an attempt to design or write the code yourself. Share your work along with details about what isn’t working.
  2. Provide Clear Documentation: Since we can’t see your project, share an annotated schematic (best) or a clear drawing of your setup. Pictures are welcome, but avoid using Fritzing diagrams as they are wiring diagrams, not schematics, and are not ideal for troubleshooting.
  3. Include Technical Details: If there is specific hardware involved, include links to technical information. There are often many versions of similar components, so precise details are essential.
  4. Reference Resources: For additional help, check out useful links and tutorials: Useful Links on Arduino Forum.
1 Like
  • This might shed some light on making a WIFI, Web page.

I see you have a start on WiFi, so I will add that you research some motor driver boards and associated libraries. Start with one of those skeleton tanks with a motor either on each of two diagonal corners, or both at one end. You will find the motor driver libraries come with sample code. Now it's just a fairly easy task of merging the two sample sketches (WiFi and motors). In fact, there is a tutorial here on the forum walking you through how to do a merge if it isn't obvious.
Good luck, have fun.

i've been working with a student on a tank in robotics. We first started with using the serial monitor commands, which require a USB cable connection, to control the tank. Then we added IR controls.

do you have serial monitor commands working? Once you do, you should work on understanding how WiFi works without the tank, then integrate that code with the tank code.

Thank you all y'all are definitely righteous I know how to do all the Wi-Fi part what the issue is I can't figure out a sketch to go with my motor board to get the motor board to get moving if I need Bluetooth first just to get things going so I can learn other stuff that's cool but what I really need help with is a sketch for the motor board like riding the sketch for the stuff for the motors like I've messed with the regular Uno's and other boards like that had ada fruit motor boards I've made tanks before I was always good find the sketches offline and then find something to make it how I want it but just to outright right up a sketch for this new motor board I can't figure it out here's a couple pics of the couple tanks I've made so far one has a radio on it and the long one the three foot one it has a whole complete stereo system on it with two amplifiers I figured I'd share LOL


which"motor board"?

Arduino motor shield r3

have you simply tried setting the direction and pwm pins?

1 Like

Ii typed up a sketch and compiled and uploaded the sketch it wen great but as soon as i add bluetooth to sketch it starts throw errors im going to start with bluetooth first i know i did something wrong here can someone show me how to fix and tell me what i did wrong ?
MYTANK.ino (1.5 KB)

please post code using the <code> icon

#include <RingBuffer.h>
#include <SoftwareSerial.h>

int RX_PIN = 0;
int TX_PIN = 1;

SoftwareSerial bluetooth(RX_PIN, TX_PIN);  // RX_PIN and TX_PIN are the pins you connected

//Motor A Config
int
  PWM_A = 3,
  DIR_A = 12,
  BRAKE_A = 9;

//Motor B Config
int
  PWM_B = 11,
  DIR_B = 13,
  BRAKE_B = 8;

void setup() {
  Serial.begin(9600);     // Set the serial monitor baud rate
  bluetooth.begin(9600);  // Set the Bluetooth baud rate
}
 pinMode(PWM_A, OUTPUT);
 pinMode(BRAKE_A, OUTPUT);
 pinMode(DIR_A, OUTPUT);
 pinMode(PWM_B, OUTPUT);
 pinMode(BRAKE_B, OUTPUT);
 pinMode(DIR_B, OUTPUT);
{
  void Car_Front()
digitalWrite(DIR_A, LOW);
analogWrite(PWM_A, 200);
digitalWrite(DIR_B, LOW);
analogWrite(PWM_B, 200);
}
  void Car_back()
digitalWrite(DIR_A, HIGH);
analogWrite(PWM_A, 200);
digitalWrite(DIR_B, HIGH);
analogWrite(PWM_B, 200);
{
  void Car_left()
digitalWrite(DIR_A, LOW);
analogWrite(PWM_A, 255);
digitalWrite(DIR_B, HIGH);
analogWrite(PWM_B, 255);
}
  void Car_right()
digitalWrite(DIR_A, HIGH);
analogWrite(PWM_A, 255);
digitalWrite(DIR_B, LOW);
analogWrite(PWM_B, 255);
{
  void Car_Stop()
digitalWrite(DIR_A, LOW);
analogWrite(PWM_A, 0);
digitalWrite(DIR_B, LOW);
analogWrite(PWM_B, 0);
}
  void Car_T_left()
digitalWrite(DIR_A, LOW);
analogWrite(PWM_A, 255);
digitalWrite(DIR_B, LOW);
analogWrite(PWM_B, 180);
{
  void Car_T_right()
digitalWrite(DIR_A, LOW);
analogWrite(PWM_A, 180);
digitalWrite(DIR_B, LOW);
analogWrite(PWM_B, 255);
}
  void loop()

Serial.printin()
bluetooth.printin() 
{

SORRY it wouldnt let me the first time lol

this isn't close to being compilable. please fix

i dont know what i did different when i got it to compile before but here it is before bluetooth its makin me crazy lol``




//Motor A Config
int
  PWM_A = 3,
  DIR_A = 12,
  BRAKE_A = 9;

//Motor B Config
int
  PWM_B = 11,
  DIR_B = 13,
  BRAKE_B = 8;

void setup() {
  Serial.begin(9600);
  pinMode(PWM_A, OUTPUT);
  pinMode(BRAKE_A, OUTPUT);
  pinMode(DIR_A, OUTPUT);
  pinMode(PWM_B, OUTPUT);
  pinMode(BRAKE_B, OUTPUT);
  pinMode(DIR_B, OUTPUT);
}
void Car_Front() 
{
  digitalWrite(DIR_A, LOW); 
  analogWrite(PWM_A, 200);
  digitalWrite(DIR_B, LOW);
  analogWrite(PWM_B, 200);
}
void Car_back()
{
 digitalWrite(DIR_A, HIGH);
 analogWrite(PWM_A, 200);
 digitalWrite(DIR_B, HIGH);
 analogWrite(PWM_B, 200);
}
void Car_left()
{
  digitalWrite(DIR_A, LOW);
  analogWrite(PWM_A, 255);
  digitalWrite(DIR_B, HIGH);
  analogWrite(PWM_B, 255);
}
void Car_right()
{
  digitalWrite(DIR_A, HIGH);
  analogWrite(PWM_A, 255);
  digitalWrite(DIR_B, LOW);
  analogWrite(PWM_B, 255);
}
void Car_Stop()
{
  digitalWrite(DIR_A, LOW);
  analogWrite(PWM_A, 0);
  digitalWrite(DIR_B, LOW);
  analogWrite(PWM_B, 0);
}
void Car_T_left()
{
  digitalWrite(DIR_A, LOW);
  analogWrite(PWM_A, 255);
  digitalWrite(DIR_B, LOW);
  analogWrite(PWM_B, 180);
}
void Car_T_right()
{
  digitalWrite(DIR_A, LOW);
  analogWrite(PWM_A, 180);
  digitalWrite(DIR_B, LOW);
  analogWrite(PWM_B, 255);
}

it lost loop()

If you're using the IDE, please just use the menu function "copy for forum" and paste the result into a new message. It'll be placed in a code box automatically, and you'll get all of it every time.
Before you do that, though, use ctrl-t to autoformat the code.

your right it compiled after that now if i can only get bluetooth to work lol