Arduino Coding newbie...

I'm creating an interactive basketball game,
but I need help with the Arduino coding.

Equipment I have:
2 -Arduino's

3 -7-Segment 6.5" Displays (found at Sparkfun)

2 - Sharps (SEN-00242 Infrared Proximity Sensor - Sharp GP2Y0A21YK AND SEN-08958 Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F)

What I need it to do:
1. Sense how far away a person is (sharp #1)
2. Do they make it into the basket? (sharp #2)
3. Add appropriate points (based on distance) to score board (0-3 ft = 2pt; 3-6ft = 5 pts; 6+ ft = 10 pts)
that's basically it.
4. after a certain amount of time, have the whole thing reset for a new user.

Does that make sense? :-?

You are more likely to get help if you ask a detailed specific question (and provide the code you have written so far, along with what problems you have with it).

Stop right there.

On the post editor's toolbar there's a # symbol, just to the right of the printer icon.
This allows you to post code in a neat box.

Go back to your previous posts, highlight the code sections, then click on the # icon on the toolbar.

There are so many things wrong with that seven-segment code (not least being the formatting - Grrrr), you may as well chuck it out and start again.

you may as well chuck it out and start again.

You're heartless, AWOL ;D

The code may be a bit crappy with all the clock-delays, sequentially looking up every character etc but, Adreamo, does it work (i.e display "dISC" ) ?

does it work (i.e display "dISC" ) ?

It doesn't even have hex digits in the 140 bytes (!) of segment lookup table, so the "d" and the "C" are going to be tricky.

{'C', 156},
{'d', 122},

To me it looks like they're there.

To me it looks like they're there

There are two sketches in that post - after reading the first (which uses whole "int"s for binary) , I'd lost the will to scroll down.

Ok, throw all that junk out, starting over!!

int segmentA = 0;
int segmentB = 1;
int segmentC = 2;
int segmentD = 3;
int segmentE = 4;
int segmentF = 5;
int segmentG = 6;
int segmentP = 7;

/*int digit1 = 10;
int digit2 = 11;
int digit3 = 12;
int digit4 = 13;*/

/*
10 digits:
 Each defines which segments should be on/off for that digit: A,B,C,D,E,F,G,P
 */
byte numbers[10] =
{
  B11000000, // 0
  B11111001, // 1
  B10100100, // 2
  B10110000, // 3
  B10011001, // 4
  B10010010, // 5
  B10000010, // 6
  B11111000, // 7
  B10000000, // 8
  B10010000  // 9
};


void setup() {
    pinMode(segmentA,OUTPUT);
  pinMode(segmentB,OUTPUT);
  pinMode(segmentC,OUTPUT);
  pinMode(segmentD,OUTPUT);
  pinMode(segmentE,OUTPUT);
  pinMode(segmentF,OUTPUT);
  pinMode(segmentG,OUTPUT);
  pinMode(segmentP,OUTPUT);

 /* pinMode(digit1,OUTPUT);
  pinMode(digit2,OUTPUT);
  pinMode(digit3,OUTPUT);
  pinMode(digit4,OUTPUT);*/
  // declare the ledPin as an OUTPUT:
  Serial.begin(9600);

}










int sharp1pin = 1;    // select the input pin for sharp1
int sharp2pin = 2;    // select the input pin for sharp2
int ledPin = 3;       // pin that the LED is attached to
int ledPin2 = 4;       // pin that the LED is attached to 
int digitPosition = 0;


void loop() {
  // read the value from the sensor:
 // sharp1Value = analogRead(sharp1pin); 
  //sharp2Value = analogRead(sharp2pin); 
  //Serial.println(sharp1Value);  
  //Serial.println(sharp2Value); 
 
 
  
  if (sharp1pin < 200) {  //IF SHARP1 SENSES LESS THAN 8FT
        digitalWrite(digitPosition +2)  
  } 
  
  
    if (sharp2pin > 200) {  //IF SHARP SENSES MORE THAN 8FT
        digitalWrite(digitPosition +3)  
  } 
  
   
   /* else {
    //do nothing
  }*/
  
  delay(100);  
}

Ok, so here's what I'm working with now, it's not working YET... suggestions??

To use the font you defined in numbers[], your code need to peek into that array.

if (sharp1pin < 200) {

sharp1pin is just a pin number. Do not confuse it with the current input value from that pin, which you can get from analogRead(sharp1pin)

  delay(100);

You may need to refresh the display more than 10 times per second to avoid flicker.

digitalWrite(digitPosition +2)

What value are you writing here?
Semicolons are recommended too.

Don't use digital pins 0 and 1: They are your serial communication pins Rx and Tx.