I need help ASAP! with programming

Hi guys i'm doing my school project and i am unable to do the program can you help with programming? i will really appreciate it with love!

The school project i am doing is a distance sensor(Max7219) connected to a 8x8 LED display (gp2y0d810z0f). So once the sensor detects something in front the LED display will a tick while if there is nothing in front a cross would be display instead.

Please help me, Thank you very much!:smiley:

Casperlee2000:
So once the sensor detects something in front the LED display will a tick

What does that mean?

What have you tried so far? It's pretty impossible to help you fix your code if we can't see it. Show us that you've put in some effort and we can help. If you don't want to put in the effort and just want someone to write it for you (and be labelled a cheater for getting pro to do your homework) then go over to the Gigs and Collaborations section and get your wallet out.

Always show us your current compete sketch.

Use CTRL T to format the sketch.
Please use code tags.
Use the </> icon in the posting menu.

[code] Paste sketch here. [/code]

int sensorPin = A0; // select the input pin for the potentiometer
int ledPin = 12, 11, 10; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
// Put values in arrays
byte use[] =
{
B10000000, // Used
B01000001,
B00100010,
B00010100,
B00001000,
B00000000,
B00000000,
B00000000
};
byte notused[] =
{
B10000001, // Notused
B0100010,
B00101000,
B00010000,
B00101000,
B01000100,
B10000010,
B00000000
};

void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
}
{
lc.shutdown(0, false); // Wake up displays
lc.shutdown(1, false);
lc.setIntensity(0, 5); // Set intensity levels
lc.setIntensity(1, 5);
lc.clearDisplay(0); // Clear Displays
lc.clearDisplay(1);
}

void loop() {
// read the value from the sensor:
sensorValue = analogRead( > 300);
// turn the ledPin on
digitalWrite(ledPin, HIGH);
// stop the program for milliseconds:
sensorValue = analogRead( < 300);
// turn the ledPin off:/
digitalWrite(ledPin, LOW);
// stop the program for for milliseconds:
delay(sensorValue);
}

This is the code i did.
Im sorry that i did not post the source code earlier

sensorValue = analogRead( > 300);

Maybe you should spend a little time looking at the language reference in regard to the syntax of the analogRead function.

void setup() {
 // declare the ledPin as an OUTPUT:
 pinMode(ledPin, OUTPUT);
}
{
 lc.shutdown(0, false); // Wake up displays
 lc.shutdown(1, false);
 lc.setIntensity(0, 5); // Set intensity levels
 lc.setIntensity(1, 5);
 lc.clearDisplay(0);  // Clear Displays
 lc.clearDisplay(1);
}

The way your curly brackets are arranged puts all of the Ic stuff outside of any function. Not good.

This is sitting outside of a function:

{
lc.shutdown(0, false) ; // Wake up displays
lc.shutdown(1, false) ;
lc.setIntensity(0, 5) ; // Set intensity levels
lc.setIntensity(1, 5) ;
lc.clearDisplay(0) ;  // Clear Displays
lc.clearDisplay(1) ;
}

You are not using code tags as you were requested.

MAX7219 is not a distance sensor.
You probably do not have 2 MAX7219's.
What is your display?
Are you allowed to cheat on your homework?

I am new to this programming world. I have volunteer for this project as i thought that this was interesting so i do not understand anything.

So once the sensor detects something in front the LED display will a tick while if there is nothing in front a cross would be display instead.

Work a bit harder on what you are asking here.

.

larryd:
This is sitting outside of a function:

{

lc.shutdown(0, false) ; // Wake up displays
lc.shutdown(1, false) ;
lc.setIntensity(0, 5) ; // Set intensity levels
lc.setIntensity(1, 5) ;
lc.clearDisplay(0) ;  // Clear Displays
lc.clearDisplay(1) ;
}





You are not using code tags as you were requested.

@Larryd what do you mean by this?

larryd:
Always show us your current compete sketch.

Use CTRL T to format the sketch.
Please use code tags.
Use the </> icon in the posting menu.

[code] Paste sketch here. [/code]

Asked for code tags, nicely I might add. Immediately posts code without them. I don't think this guy is taking us very seriously. Maybe he is just wasting our time. I vote to leave him to do his own homework if he's just going to disrespect our group like that.

All code must be inside if a function.
The code quoted is not in either setup() or loop()

Majority rules I am gone.
.

I don't like the title "I need help ASAP! with programming"

People who write "ASAP" are usually trying to jump the queue and get their answers before other more patient people. That's not nice.

@Casperlee2000, it's not our fault if you left it too late to do your homework.

...R

int ledPin = 12, 11, 10;    // select the pin for the LEDWhich pin is the LED attached to ? Not that it matters because this line does not compile.

Casperlee2000:
Hi guys i'm doing my school project

Casperlee2000:
I have volunteer for this project

What kind of school is this?
It's perfectly normal to not know anything at the start of a project, but the point of doing a project is to learn and demonstrate your learning.
However it just looks like your project is 'how to copy code from the internet' and 'how not to ask others to do your work for you'.