I have problem in space... arduino uno

hi everyone
I finished my project then I tried it... the code is alot ... no space... and my project submission after 2 days
how to solve this problem ?
do I have to buy arduino mega or there is another solution ?
thanks in advanced

You could start by posting your code (all of it, and in code tags, please). I would think that there are a lot of ways to reduce the code size. There usually is.

Of course, you coud just buy a larger Arduino, but we can't quite see what you've got now, for some reason

I have arduino uno... but i need more space about more than 7000 bytes.. do u recommend me to buy arduino mega ?

7000 bytes of what?
RAM?
Flash?
EEPROM?
SD?

Quit being so vague.

this is the problem..... from arduino uno
'Sketch uses 9,038 bytes (7%) of program storage space. Maximum is 126,976 bytes.
Global variables use 870 bytes (10%) of dynamic memory, leaving 7,322 bytes for local variables. Maximum is 8,192 bytes.
avrdude: stk500_getsync(): not in sync: resp=0x00'

You need to select the correct processor.
An Uno doesn't have 126976 bytes.

sorry the problem is this
Sketch uses 7,118 bytes (22%) of program storage space. Maximum is 32,256 bytes.
Global variables use 384 bytes (18%) of dynamic memory, leaving 1,664 bytes for local variables. Maximum is 2,048 bytes.

so wt do u recommend me ?
to buy arduino mega or wt to do ?
I'm new donno about arduino alot .... and i have questions
does the code different from arduino uno ... ? and different pins ? or the same?

sorry the problem is this

I'm not seeing any problem.
You appear to have plenty of resources.

I finished my project then I tried it... the code is alot ... no space

That doesn't make sense- how did you finish it if it didn't fit?

But as AWOL has said you seem to have plenty of space- it's using 1/4

This error:

avrdude: stk500_getsync(): not in sync: resp=0x00'

.... might mean something else like a communications problem and maybe it's not uploading? (I must confess those messages mean about zilch to me....)

Ms_Hanadi:
I finished my project then I tried it

At the moment I don't see any evidence that you have a space problem, but if you have coded your whole project and not tested any of it then I'm afraid you are making life very difficult for yourself - that is not a good way to do development. It's pretty unlikely that your first stab at the solution is perfect, and the more code you try to debug in one go the harder it is. It's far better to test the individual features as you develop them so that you know the pieces all work before you try to integrate them into your overall project.

It's far better to test the individual features as you develop them so that you know the pieces all work before you try to integrate them into your overall project.

I was actually wondering if that wasn't the problem: maybe tried a modular approach with small sketches, then they were too big when bolted together? (Except for the fact that it doesn't seem too big....)

Ms_Hanadi:
avrdude: stk500_getsync(): not in sync: resp=0x00'

This is not a size problem, it will either be a wrong COM port choice, a wrong board type choice, or the COM port in use.

Use the Tools menu in the IDE to

a. set the CoM port
b. Set the board type

Make sure the Arduino is on the COM port you think it is. You can do this, if you are running Windows, by..

Start (big Microsoft Start Button), right-click Computer, select Properties, then select Device Manager. Click on Ports, and you should see something like "Arduino Uno on COM4.

Make sure the COM port thew Arduino is on, is not in use by another program.

AWOL:

sorry the problem is this

I'm not seeing any problem.
You appear to have plenty of resources.

I'll bet there's a ton of data like character strings sucking up all the ram (i.e. stuff that SHOULD be in PROGMEM).

yes u r right ........ in the PROGMEM
so wt should i do ?

What should you do?

Start typing whole words, post your code, tell us what it does, tell us what it doesn't do.
The usual stuff.

my idea is this .... 3 ultrasonic for 3 directions .. right , left and straight...
for the blindness people ....
if any object will be in front any ultrasonic the speaker will say the direction .. for example .. if in right direction the speaker will say right to make the person not collide the object..... and the same for the rest .....
my code is this ...

#include <SoftwareSerial.h>
#include <PCM.h>
SoftwareSerial port1(2,3);
SoftwareSerial port2(4,5);
SoftwareSerial port3(6,7);
const unsigned char sample [] PROGMEM = {
126, 126, 126, 126, 126, 126, 126, 126, 126, ......... more than 3 pages 
};
const unsigned char right[] PROGMEM = {
129, 129, 128, 127, 127, 128, 128, 128, 127.......... more than 3 pages 
};

const unsigned char straight[] PROGMEM = {
129, 129, 129, 129, 128, 128, 129, 128, 128, 128.........more than 3 pages 
};
void setup()
{
Serial.begin(9600);
port1.begin(9600);
port2.begin(9600);
port3.begin(9600);
}
void loop()
{
range1();
range2();
range3();
}
void range1()
{
char inBuffer[20];
int nBytes;
port1.listen();
nBytes=port1.readBytesUntil(0x0d,inBuffer,20);
if(nBytes==8)
{
int range=(inBuffer[0]-48)*100 + (inBuffer[1]-48)*10 + (inBuffer[2]-48);
if(range<50)
{
startPlayback(sample, sizeof(sample));
Serial.println("Left");
}
}
}
void range2()
{
char inBuffer[20];
int nBytes;
port2.listen();
nBytes=port2.readBytesUntil(0x0d,inBuffer,20);
if(nBytes==8)
{
int range=(inBuffer[0]-48)*100 + (inBuffer[1]-48)*10 + (inBuffer[2]-48);
if(range<50)
{
startPlayback(right, sizeof(right));
Serial.println("Right");
}
}
}
void range3()
{
char inBuffer[20];
int nBytes;
port3.listen();
nBytes=port3.readBytesUntil(0x0d,inBuffer,20);
if(nBytes==8)
{
int range=(inBuffer[0]-48)*100 + (inBuffer[1]-48)*10 + (inBuffer[2]-48);
if(range<50)
{
startPlayback(straight, sizeof(straight));
Serial.println("straight");
}
}
}

when i run it the arduino says for me the sketch too big ....
i'm using arduino uno
now wt is the solution ?
do i have to buy arduino mega ?
and does the arduino mega like arduino uno in programming ? or not?
and thanks in advanced
i have to finish my project in 2 days coz i have presentation in front of my whole college ....
thanks again

when i run it the arduino says for me the sketch too big

Where does it say that?

in the black box .... down the code board ...

If you want help, post code that compiles.

in the black box .... down the code board ..

I have no idea what that means

in the console