0

I don't have port, but when I want to compile my code (even empty files), I encounter this error:

Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

The code is:

int LED_red=4;
int LED_yellow =2;
int green =0;

void setup() {
  // put your setup code here, to run once:
  pinMode(LED_red,OUTPUT);
  pinMode(LED_yellow,OUTPUT);
  pinMode(green,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED_red,HIGH);
  digitalWrite(LED_yellow,LOW);
  digitalWrite(green ,LOW);
  delay(5000);
  digitalWrite(LED_yellow,HIGH);
  digitalWrite(LED_red,LOW);
  digitalWrite(green,LOW);
  delay(5000);
  digitalWrite(green,HIGH);
  digitalWrite(LED_yellow,LOW);
  digitalWrite(LED_red,LOW);
  delay(5000);
}
Sketch uses 998 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

I want a hex address for cordinate this code with Proteus, but it doesn't compile and dosn't give me hex address.

3
  • 2
    I don't think that's an error. It looks like the report regarding how much of the target processors resources you are using. From the looks of it, you program is very small and will most certainly fit the target processor you have chosen.
    – st2000
    Aug 2, 2021 at 13:37
  • Where is the Stack Overflow you mention in your question title? As others noted, your “error” is just a summary generated after successfully compiling your code and not an actual error.
    – StarCat
    Aug 2, 2021 at 14:13
  • What is the exact issue? As has been mentioned many times, your code compiles fine according to the output you’ve shown. You are not showing us any evidence of a problem. What does “I want hex address for cordinate this code with Proteus” mean? What hex address? Are you trying this with Proteus or with the Arduino IDE?
    – StarCat
    Aug 2, 2021 at 21:32

4 Answers 4

2

Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

This is not an error message. Rather, it's a message that results from a successful compile of your empty programme.

Sketch uses 998 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

Neither is this an error message. Rather, it's a message that results from a successful compile of your more substantial programme.

To export the HEX file from the Arduino IDE for Proteus, go to:

  • Menu bar -> Sketch -> Export compiled Binary

The short-cut is Ctrl+Alt+S.

You will find the .hex file in the same directory as your sketch.

2
  • Tanks a lot , your answer was so useful for me!
    – dorsa
    Aug 3, 2021 at 7:49
  • @dorsa, thanks. If it answers your question, be sure to accept it by clicking on the tick to left of it.
    – tim
    Aug 3, 2021 at 9:45
1

There is nothing to do.

What you are seeing is not an error. It is merely an informational message telling you how much of the available resources your sketch is using. Since it is using far less than the maximum available (as you would expect from an empty sketch) you have no problem.

You only need to worry about those figures when the "amount left" gets too small.

6
  • tanks a lot , but I want a hxe address for زcordinate this code with Proteus but it doesnt compile and dosent gove me hxe address ; can you tell me what should I do please?
    – dorsa
    Aug 2, 2021 at 16:08
  • @dorsa What code? What exactly are you trying to do?
    – Majenko
    Aug 2, 2021 at 17:07
  • int LED_red=4; int LED_yellow =2; int green =0; void setup() { pinMode(LED_red,OUTPUT); pinMode(LED_yellow,OUTPUT); pinMode(green,OUTPUT); } void loop() { digitalWrite(LED_red,HIGH); digitalWrite(LED_yellow,LOW); digitalWrite(green ,LOW); delay(5000); digitalWrite(LED_yellow,HIGH); digitalWrite(LED_red,LOW); digitalWrite(green,LOW); delay(5000); digitalWrite(green,HIGH); digitalWrite(LED_yellow,LOW); digitalWrite(LED_red,LOW); delay(5000); }
    – dorsa
    Aug 2, 2021 at 17:57
  • @dorsa Please, don't post code in comments. Edit your question and provide all the information. Including what actual error you get when you try and compile.
    – Majenko
    Aug 2, 2021 at 18:03
  • 1
    @dorsa There still is no error. What is your actual problem?
    – Majenko
    Aug 2, 2021 at 19:28
0

What you are seeing is not an error.

Although your sketch is empty, there is Arduino framework code that gets created with it. This code actually calls your setup() and loop() functions so things operate as you would expect. It was designed this way to make it eaiser to get started.

2
  • thanks but I do not know what to do , can you help me again please and told me what to fo
    – dorsa
    Aug 2, 2021 at 14:09
  • @dorsa, you don’t have to do anything except upload your code to Arduino. Please follow a tutorial that explains the basics of how the Arduino IDE works, such as this one.
    – StarCat
    Aug 2, 2021 at 14:16
0

You can change the processor settings from Tools-->Processor-->Atmega328P(Bootloader). It solved my problem.

1
  • 1
    Please explain how this solves the "problem". What was your error message?
    – Nick Gammon
    Apr 13 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.