# I am getting this error though the programming is right

**URL:** <https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504>\
**Category:** Programming\
**Created:** [January 3, 2022, 9:47am UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504 "2022-01-03T09:47:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![arnav\_swaraj](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@arnav\_swaraj](https://forum.arduino.cc/u/arnav_swaraj)\
**Post date:** [January 3, 2022, 9:47am UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/1 "2022-01-03T09:47:47Z")

</div>

I am not sure what this error msg means but its something related to the Bluetooth module i am using. Please help.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/4/a/7/4a71e70826eafcf202140dc328812766200e4674.png)

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [January 3, 2022, 9:58am UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/2 "2022-01-03T09:58:48Z")

</div>

Please do not post error messages that way. Do you see the button "Copy error messages"? Click that and then paste into your post between code tags.

Why do you believe this error message is because of a Bluetooth module? How is it connected? Please post a schematic.

---

<div class="post-metadata">

**Author:** ![anon73444976](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon73444976](https://forum.arduino.cc/u/anon73444976)\
**Post date:** [January 3, 2022, 10:00am UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/3 "2022-01-03T10:00:18Z")

</div>

The IDE thinks it is talking to a Uno.  
What do you think it is talking to?

---

<div class="post-metadata">

**Author:** ![TechGraphix](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/techgraphix/32/501257_2.png) [@TechGraphix](https://forum.arduino.cc/u/TechGraphix)\
**Post date:** [January 3, 2022, 10:16am UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/4 "2022-01-03T10:16:58Z")

</div>

First thing i see is a problem uploading the program to the board..  
A few things to check.. - Is the right board chosen (in Tools\>Board..)

- is the right Port chosen (in Tools\>Port)
- can you get Board Info.

I had similar problems a while ago and solved it by placing a fresh Bootloaded Processor on the board after checking all settings.. After that i bootloaded the (corrupted?) processor again and it works fine since..  
Having one or two boards spare can help you out in case of.....

---

<div class="post-metadata">

**Author:** ![arnav\_swaraj](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@arnav\_swaraj](https://forum.arduino.cc/u/arnav_swaraj)\
**Post date:** [January 3, 2022, 11:25am UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/5 "2022-01-03T11:25:25Z")

</div>

Here is the schematic.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/b/b/3/bb35ac1b1d38e8320ab3f7a4c2bcf97d35d719c3.jpeg)

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [January 3, 2022, 11:27am UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/6 "2022-01-03T11:27:46Z")

</div>

> [@arnav\_swaraj](#):
>
> Here is the schematic.

No that is not a schematic it is a useless physical layout diagram.

---

<div class="post-metadata">

**Author:** ![Idahowalker](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/idahowalker/32/238858_2.png) [@Idahowalker](https://forum.arduino.cc/u/Idahowalker)\
**Post date:** [January 3, 2022, 12:05pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/7 "2022-01-03T12:05:18Z")

</div>

You'll need to use software serial on the Uno.

Code posted as an image is poo!

Post your code in code tags.

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [January 3, 2022, 12:30pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/8 "2022-01-03T12:30:27Z")

</div>

Disconnect the UNO from all that junk and try.

Restart the IDE and try.

Pick a different USB port and try.

Use a different USB cable and try.

Reboot your machine and try.

Until you’ve tried ten things, don’t worry.

I can’t speak for everyone, but I get this problem occasionally - use all the advices up to this point.

It will probably start working again just like it stopped.

HTH

a7

---

<div class="post-metadata">

**Author:** ![StefanL38](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefanl38/32/713548_2.png) [@StefanL38](https://forum.arduino.cc/u/StefanL38)\
**Post date:** [January 3, 2022, 12:35pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/9 "2022-01-03T12:35:20Z")

</div>

Your bluetooth-module is connected to IO-pins 0 and 1

If you connect the bluetooth-module to the exact same IO-pins that are used for uploading code into the Arduino the bluetooth-module is disturbing the upload process.

If you change to some other IO-pins and use software-serial at a baudrate of maximum 19200 baud. (no higher baudrates as higher baudrates are unreliable on software-serial)

Then you can upload code any time without the need to disconnect the bluetooth module.

best regards Stefan

---

<div class="post-metadata">

**Author:** ![arnav\_swaraj](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@arnav\_swaraj](https://forum.arduino.cc/u/arnav_swaraj)\
**Post date:** [January 3, 2022, 2:15pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/10 "2022-01-03T14:15:45Z")

</div>

Hello, I tried using 'software serial' and the initial problem was gone but the upload was stuck and I was not able to connect my HC - 05 Bluetooth-Module.

---

<div class="post-metadata">

**Author:** ![Idahowalker](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/idahowalker/32/238858_2.png) [@Idahowalker](https://forum.arduino.cc/u/Idahowalker)\
**Post date:** [January 3, 2022, 2:16pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/11 "2022-01-03T14:16:37Z")

</div>

Did you post that code where you tried software serial so we could take a look at it and see the issue?

> [@arnav\_swaraj](#):
>
> but the upload was stuck

What does that mean?

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [January 3, 2022, 2:36pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/12 "2022-01-03T14:36:05Z")

</div>

> [@arnav\_swaraj](#):
>
> Here is the schematic.

Here are my comments on your diagram:

1. It is not a schematic
2. 4XAA batteries is not enough voltage for the regulator on the motor driver module to output 5V
3. The 5V output from the motor driver module should be connected to the 5V pin on the Uno, not the Vin pin
4. Connecting the Bluetooth module to pins 0, 1 on the Uno will prevent sketch upload. You need to use software serial on some other pins.
5. Your Head Light led needs a series resistor, otherwise the Uno pin can be damaged.

---

<div class="post-metadata">

**Author:** ![arnav\_swaraj](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@arnav\_swaraj](https://forum.arduino.cc/u/arnav_swaraj)\
**Post date:** [January 3, 2022, 3:25pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/13 "2022-01-03T15:25:28Z")

</div>

Ok, thanks your comments were very helpful but for the last comment I decided to not use the headlight led and I used 'software serial' and there is no error message but it is not uploading completely (The bar) so I am not able to connect to my HC - 05. For your first comment then what power source should I use? Can i use a 9v battery?

---

<div class="post-metadata">

**Author:** ![anon57585045](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon57585045](https://forum.arduino.cc/u/anon57585045)\
**Post date:** [January 3, 2022, 3:29pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/14 "2022-01-03T15:29:40Z")

</div>

Please reply only with the schematic that was requested. Except, have you tried uploading to the board, with no peripheral hardware connected to it?

Edit- sorry one question though... what is powering the Arduino? I see no power connections going to it.

---

<div class="post-metadata">

**Author:** ![arnav\_swaraj](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@arnav\_swaraj](https://forum.arduino.cc/u/arnav_swaraj)\
**Post date:** [January 3, 2022, 3:34pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/15 "2022-01-03T15:34:34Z")

</div>

Here it is:

#include \<SoftwareSerial.h\>  
char t;

void setup() {  
pinMode(13,OUTPUT); //left motors forward  
pinMode(12,OUTPUT); //left motors reverse  
pinMode(11,OUTPUT); //right motors forward  
pinMode(10,OUTPUT); //right motors reverse

Serial.begin(9600);

}

void loop() {  
if(Serial.available()){  
t = Serial.read();  
Serial.println(t);  
}

if(t == '1'){ //move forward(all motors rotate in forward direction)  
digitalWrite(13,HIGH);  
digitalWrite(11,HIGH);  
}

else if(t == '2'){ //move reverse (all motors rotate in reverse direction)  
digitalWrite(12,HIGH);  
digitalWrite(10,HIGH);  
}

else if(t == '4'){ //turn right (left side motors rotate in forward direction, right side motors doesn't rotate)  
digitalWrite(11,HIGH);  
}

else if(t == '3'){ //turn left (right side motors rotate in forward direction, left side motors doesn't rotate)  
digitalWrite(13,HIGH);  
}  
delay(100);  
}

---

<div class="post-metadata">

**Author:** ![anon57585045](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon57585045](https://forum.arduino.cc/u/anon57585045)\
**Post date:** [January 3, 2022, 3:35pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/16 "2022-01-03T15:35:15Z")

</div>

Please edit your post and place it inside code tags, as strongly urged by the forum guidelines.

---

<div class="post-metadata">

**Author:** ![arnav\_swaraj](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@arnav\_swaraj](https://forum.arduino.cc/u/arnav_swaraj)\
**Post date:** [January 3, 2022, 3:36pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/17 "2022-01-03T15:36:18Z")

</div>

Hello, I am currently Powering the board with 4 AA batteries but the voltage is not enough so I will have to find a alternative.

---

<div class="post-metadata">

**Author:** ![anon57585045](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon57585045](https://forum.arduino.cc/u/anon57585045)\
**Post date:** [January 3, 2022, 3:38pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/18 "2022-01-03T15:38:06Z")

</div>

That is why I asked you to refrain from posting until you can supply a schematic. Such words don't indicate where you applied the battery power to. Also I've noticed that you don't answer all the questions. Things are not going to progress smoothly unless you pay attention to the questions and answer them all.

---

<div class="post-metadata">

**Author:** ![arnav\_swaraj](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@arnav\_swaraj](https://forum.arduino.cc/u/arnav_swaraj)\
**Post date:** [January 3, 2022, 3:39pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/19 "2022-01-03T15:39:17Z")

</div>

ok will do

---

<div class="post-metadata">

**Author:** ![anon57585045](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon57585045](https://forum.arduino.cc/u/anon57585045)\
**Post date:** [January 3, 2022, 3:39pm UTC](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504/20 "2022-01-03T15:39:54Z")

</div>

Great, we really need a complete schematic with all your latest changes... if you really want to speed things up, also post images of your hardware setup.

[Next page](https://forum.arduino.cc/t/i-am-getting-this-error-though-the-programming-is-right/942504.md?page=2)
