Arduino/Genuino UNO no Longer Available, yet Problems Ensue

Not sure what Category this ought to be in, hopefully this is correct...
I have the Arduino UNO board from the older smart Robot kit from Elegoo, V2.0, I think. (Same kit as in the forum linked below, maybe different version.) I am now trying to use this board and upload some script that partially came from the kit's code itself. The sketch shows that it has uploaded successfully, but when I test out the device, the motors do not run as they ought to. I know that the Arduino/Genuino UNO selection is no longer available under "Boards", and I have selected Arduino UNO instead.
I found this article with a very similar problem:

However, as aforementioned, the sketch uploads fine, but then nothing happens. At all. No movement, nothing. The port is correctly selected. I get 0 errors. How do I get my sketch to run properly?? It has been brought to my attention that there are some issues with running an AtMega328P Processor, and I just need to select that "Processor" under "Tools"... However, that selection is gone as well.
Please Help; This is on a schedule... I am utterly confused!
Thank you in advance!

If I were you, especially on a schedule, I'd bite the bullet and buy a new board.

Do any sketches work?- blink or blink without delay, for instance?

Unless you know that NO sketches work, if your sketch doesn't work you can't say if the sketch isn't faulty in the first place.

Yes, the blink sketch does work. I have had an extremely experienced Arduinoist check my sketch as well. There ought to be no errors, even if there are...

  1. "Compile" should catch them.
  2. I know that the device should physically do something anyway.

Doesn't that point to the board being ok and correctly selected etc in the ide?

Checked how, though? A walk through of the code? Those can help of course but there's no substitute for running it on known-good hardware!

I'm an extremely experienced Arduinoist, but even the most experienced users can miss stuff.

Maybe you should post the code and schematic, and someone can double check it. Maybe someone has the same hardware and can build what you have.

And of course compiling won't catch errors of logic :wink:

edit... have you got a blinking led or serial prints in your code? At least something in setup() as a simple proof-of-life? I usually have some prints in setup() to show the name of the sketch and to say something like "setup done, starting loop".

This is much more likely to be power issue. If you temporarily replace the motors with leds (and series resistor) do you see anything?
Otherwise, show your code and a schematic.

That was a bit ambiguous to me... not sure if it means the motors aren't running at all, or if they're running but not correctly.

I apologize, but I am inexperienced in schematics, and the program I use for creating them did not have the correct parts needed to create a schematic for this project. I am using the expansion board that came with the robot kit, as well as the four "project motors" that were in the same kit. (And, of course, I'm also using the motor driver that came with the kit.) Everything is plugged in as it should be, it is rather fool-proof as you can only plug things in at certain places.

I would also like to note that even the code from the creators (which used to work, by the way) does not function with my Arduino unit.

The motors are not running at all.

Here is a link to my code.

I would be very inclined to put some serial prints in strategic parts of that sketch, like at the end of setup() to say setup's done, and in each of the turn functions to see if the code ever gets there.

I will try that and let you know how it goes...

I used three times of printing to the serial monitor, one right before the loop, and two in the midst of the loop, all of which are correctly posted.

Which at least tells us the code is running, which we didn't actually know before...

But that doesn't tell you the turn functions are being called when they should be, so I'd put prints in the functions too, to test your program flow.

Also as 6v6gt suggested, replace the motors with leds to see if they light up maybe? Perhaps the motors are being correctly controlled but don't have enough power to turn.

@sky777, because you can upload to the board, this has nothing to do with Avrdude, stk500 or Bootloader and your topic has been moved to a more suitable location on the forum.

That only applies if you use a Nano. And you don't use a Nano so forget about it.

Draw with pencil and paper, take a photo of that and add it to a reply.

Please provide a link so we don't have to chase it and possibly find the wrong one.

Please learn to post code in a post using code tags; I've done it this time for you. Most people are reluctant to go to other sites.

//These switches are ordered from left to right when the bot is facing away from you. SWL1 = First switch on the left side.
//#define takes up less room than const int
const int swL1=0; //This and the next three switches need pin numbers, but I am leaving them at 0 until I can ask Kyle my questions
const int swL2=0;
const int swR1=0;
const int swR2=0;
const int ENB=5; //Enable side B
const int ENA=6; //Enable side A
const int IN1=11; //Init #1
const int IN2=9; //Init #2
const int IN3=8; //Init #3
const int IN4=7; //Init #4

//IN1-IN4 I reversed the pin numbers, because that is how they are shown on the board.

//Variable Integers:
int brushSpeed=0; //The speed of the brush

//New Functions:
void blockageLeft() { //In the event of an object blocking the robot's path on the left side

}

void blockageRight() { //In the event of an object blocking the robot's path on the right side

}

void lTurn(int speed,int length) { //Turn left
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);
  analogWrite(ENB, speed);
  delay(length);
}

void rTurn(int speed,int length) { //Turn right
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  analogWrite(ENA, speed);
  delay(length);
}

void fDrive(int speed,int length) { //Drive forwards
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  analogWrite(ENA,speed);
  analogWrite(ENB,speed);
  delay(length);
}

void bDrive(int speed,int length) { //Drive backwards
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);
  analogWrite(ENA,speed);
  analogWrite(ENB,speed);
  delay(length);
}

void setup() {
  Serial.begin(9600);

  //To declare each pin an input or output


  pinMode(IN1,OUTPUT);
  pinMode(IN2,OUTPUT);
  pinMode(IN3,OUTPUT);
  pinMode(IN4,OUTPUT);
  pinMode(ENA,OUTPUT);
  pinMode(ENB,OUTPUT);


}

void loop() {
  lTurn(255,5000); //I want this command...
  analogWrite(ENB, 255); //...To do the same things this and the next three things are doing.
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  delay(5000);
  /*But neither of these two pieces of code work properly; when I try a code that was 
  written for this board, it does not work either. yet I have wired all the motors 
  and the board as shown.*/
}

/* Here is what the code from the kit tells me to enter:
(For Rotation of the left motors):
//www.elegoo.com

//     Left motor truth table
//Here are some handy tables to show the various modes of operation.
//  ENB         IN1               IN2         Description  
//  LOW   Not Applicable    Not Applicable    Motor is off
//  HIGH        LOW               LOW         Motor is stopped (brakes)
//  HIGH        HIGH              LOW         Motor is on and turning forwards
//  HIGH        LOW               HIGH        Motor is on and turning backwards
//  HIGH        HIGH              HIGH        Motor is stopped (brakes)

// define IO pin
#define ENB 5 
#define IN1 7
#define IN2 8

//init the car
void setup() {
  pinMode(IN1, OUTPUT);     //set IO pin mode OUTPUT
  pinMode(IN2, OUTPUT);
  pinMode(ENB, OUTPUT);
  digitalWrite(ENB, HIGH);  //Enable left motor
}

//mian loop
void loop() {
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);   //Right wheel turning forwards
  delay(1000);              //delay 500ms
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, LOW);   //Right wheel stoped
  delay(1000);
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, HIGH);  //Right wheel turning backwards
  delay(1000);
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, HIGH);  //Right wheel stoped
  delay(1000);
}

This was just for the left motors, the right motors are similar.
*/

Hi @sky777
To add code please click this link;

Thanks... Tom... :smiley: :+1: :coffee: :australia:

Alright, I'll use a code tag next time... I was trying to stay away from it because it makes the reply or message a mess, really long, and (in my opinion) annoying. But that's fine, if that's what the community wants, I'll do it.
Also...

I meant inexperienced as in, I don't use them or have not even drawn one, even with the multiple projects I have done.

//These switches are ordered from left to right when the bot is facing away from you. SWL1 = First switch on the left side.
//#define takes up less room than const int
const int swL1=0; //This and the next three switches need pin numbers, but I am leaving them at 0 until I can ask Kyle my questions
const int swL2=0;
const int swR1=0;
const int swR2=0;
const int ENB=5; //Enable side B
const int ENA=6; //Enable side A
const int IN1=11; //Init #1
const int IN2=9; //Init #2
const int IN3=8; //Init #3
const int IN4=7; //Init #4

//IN1-IN4 I reversed the pin numbers, because that is how they are shown on the board.

//Variable Integers:
int brushSpeed=0; //The speed of the brush

//New Functions:
void blockageLeft() { //In the event of an object blocking the robot's path on the left side

}

void blockageRight() { //In the event of an object blocking the robot's path on the right side

}

void lTurn(int speed,int length) { //Turn left
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);
  analogWrite(ENB, speed);
  delay(length);
}

void rTurn(int speed,int length) { //Turn right
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  analogWrite(ENA, speed);
  delay(length);
}

void fDrive(int speed,int length) { //Drive forwards
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  analogWrite(ENA,speed);
  analogWrite(ENB,speed);
  delay(length);
}

void bDrive(int speed,int length) { //Drive backwards
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);
  analogWrite(ENA,speed);
  analogWrite(ENB,speed);
  delay(length);
}

void setup() {
  Serial.begin(9600);

  //To declare each pin an input or output


  pinMode(IN1,OUTPUT);
  pinMode(IN2,OUTPUT);
  pinMode(IN3,OUTPUT);
  pinMode(IN4,OUTPUT);
  pinMode(ENA,OUTPUT);
  pinMode(ENB,OUTPUT);


}

void loop() {
  lTurn(255,5000); //I want this command...
  analogWrite(ENB, 255); //...To do the same things this and the next three things are doing.
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  delay(5000);
  /*But neither of these two pieces of code work properly; when I try a code that was 
  written for this board, it does not work either. yet I have wired all the motors 
  and the board as shown.*/
}

/* Here is what the code from the kit tells me to enter:
(For Rotation of the left motors):
//www.elegoo.com

//     Left motor truth table
//Here are some handy tables to show the various modes of operation.
//  ENB         IN1               IN2         Description  
//  LOW   Not Applicable    Not Applicable    Motor is off
//  HIGH        LOW               LOW         Motor is stopped (brakes)
//  HIGH        HIGH              LOW         Motor is on and turning forwards
//  HIGH        LOW               HIGH        Motor is on and turning backwards
//  HIGH        HIGH              HIGH        Motor is stopped (brakes)

// define IO pin
#define ENB 5 
#define IN1 7
#define IN2 8

//init the car
void setup() {
  pinMode(IN1, OUTPUT);     //set IO pin mode OUTPUT
  pinMode(IN2, OUTPUT);
  pinMode(ENB, OUTPUT);
  digitalWrite(ENB, HIGH);  //Enable left motor
}

//mian loop
void loop() {
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);   //Right wheel turning forwards
  delay(1000);              //delay 500ms
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, LOW);   //Right wheel stoped
  delay(1000);
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, HIGH);  //Right wheel turning backwards
  delay(1000);
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, HIGH);  //Right wheel stoped
  delay(1000);
}

This was just for the left motors, the right motors are similar.
*/

Where is the mess, the code is in a neat scrolling window, also posting your code off forum makes it difficult for some non pc, non laptop, platforms.
[soapbox]

If you want to do this in industry or commercially, that attitude will not go down well.
If you can understand a circuit and build it, you can draw it.
Where did all your learning come from if not for some part circuit diagrams.
[/soapbox]

Tom... :smiley: :+1: :coffee: :australia:

Here is an image of what I am using, at least...
So I have the Arduino UNO Board, with the expansion board from the kit connected to it. The expansion board is connected by (Ground, VIn) and (Pins 5-9, 11) to a motor driver, which is currently driving four motors.

Also, dumb question... what is [Soapbox] ? LOL sorry

I know, but I have not gotten to that point yet, I certainly want to learn schematics, it just seems out of my range right now.

Other people as well as handbooks, parts manuals, trial and error, and lots of failure. Trial and error is a great teacher....
Some of the manuals had Fritzing diagrams, of course. But aren't you all talking about the line sketches, like as follows?

If you have those motors only powered via the USB connection it won’t work , you need a separate supply capable of driving those pumps connected to your motor driver.

There is nothing hard about drawing schematics by hand , a quick google will get you started . By having a schematic you can then do some calculations of voltages current etc and check your physical wiring against it . It’s essential you get to grips with that , to a least prevent you destroying parts .

Hi,
Thanks for the image.
You are using low voltage hobby motors through an inefficient motor driver from a 5V supply.

That driver will drop up to 2V from your 5V supply then only have 3V for the motors.

Have you replaced the motors with LEDS to see if you have some output?
Have you applied a DMM to the motor terminals to see if there is a voltage being applied to the motors?

Just write some code that JUST tries to control ONE motor.

I am sure you can do that, and get your DMM out to do some measurements.

Tom.. :smiley: :+1: :coffee: :australia: