How to make ultrasonic sensor have high-low output

My only available pins in my project are pins 12 and 13,I needed 25 cm of detection range so it will have a simple operation

Are you looking to make one or buy one? Do you need a continous range or just a trip when something is within ths range?

I have a US-100 ultrasonic sensor,all I need is to program arduino because I am going to use it in my sumo robot,two infrared collision sensors on the side,pin 8,9,10,and 11 are used for my homemade motor shield,a 3 channel line sensor to detect edges,and I need the us-100 to be the front sensor

all I need is to program arduino

Google is your friend:-

actually I need my sensor to send a low signal to the arduino if an object is in front and send a high when an object goes out of the way

actually I need my sensor to send a low signal to the arduino if an object is in front and send a high when an object goes out of the way

No you don’t. Just program it to accept the inverted levels.

If it is for other parts of the code then just invert what you read. If it is a booliean variable the ~ operator inverts it.

Can I program it to detect 25cm? and here is my code,I just need to replace the infrared collision sensor pin 2,with the us-100

I/O Usage

- collision sensor inputs
2- colision1 as input
3- colision2 as input/this is the one that needs to be replaced
4- colision3 as input

-line sensor inputs
5- linesense1 as input low on black
6- linesense2 as input
7- linesense3 as input

-motor control output
8 - mot2 dir as output high=fwd
9 - mot2 run as output
11 - mot1 dir as output high= fwd
10 - mot1 run as output

int  col1= 2;
int  col2= 3;
int  col3= 4;
int  ls1 = 5;
int  ls2 = 6;
int  ls3 = 7;
int  m2dir = 8;
int m2run = 9;
int m1dir = 11;
int m1run = 10;

// The setup() method runs once, when the sketch starts

void setup()   {                

  pinMode(col1, INPUT);
  pinMode(col2, INPUT);
  pinMode(col3, INPUT);  
  pinMode(ls1, INPUT);
  pinMode(ls2, INPUT);
  pinMode(ls3, INPUT);
  pinMode(m2dir, OUTPUT);
  pinMode(m2run, OUTPUT);
  pinMode(m1dir, OUTPUT);
  pinMode(m1run, OUTPUT);

// the loop() method runs over and over again,
// as long as the Arduino has power

int  colsense;
int stuckdetect;
int linesense;
long timer=1000;
boolean randdec;
int  mode;

void loop()                     
  if(digitalRead(col1)==LOW) colsense=1;
  if(digitalRead(col2)==LOW) colsense=colsense+2;
  if(digitalRead(col3)==LOW) colsense=colsense+4;
  if(digitalRead(ls1)==LOW) linesense=1;
  if(digitalRead(ls2)==LOW) linesense=linesense+2;
  if(digitalRead(ls3)==LOW) linesense=linesense+4;
  // random decision maker
  // Check if black border is encountered, back off
  if(linesense !=0)
    randomSeed(millis());    //randomize everything
    //rotate to keep within arena
  if(linesense ==0)
      // enemy straight ahead, ram it
    //Obstruction 1
        analogWrite(m1run, 250);
        analogWrite(m1run, 150);
        analogWrite(m2run, 250);
        analogWrite(m2run, 150);
  if((linesense==0) & (colsense==0))
  // search for enemy mode
    // chane search mode after random time
      timer=millis()+ random(500,1000);  // change interval random at 1 to 5 sec
      if(mode==1) rotBot(150,randdec);
      if(mode==2) runBot(150,100,HIGH);
      if(mode==3) runBot(100,150,HIGH);
      if(mode==4) runBot(100,100,HIGH);
      if(mode>4) Stop();

void runBot(int spd1,int spd2, boolean direction )
    analogWrite(m1run, spd1);
    analogWrite(m2run, spd2); 

void rotBot(int speed, boolean direction)
    analogWrite(m2run, speed);
    analogWrite(m1run, speed); 

void Stop(void)
    analogWrite(m2run, 0);
    analogWrite(m1run, 0); 

It is quite poor code. Just replace the line

if(digitalRead(col2)==LOW) colsense=colsense+2;

With a call to the function that reads the sensor in place of the digital read.

I think the main problem here is that you know so very little about code that you are unable to understand the help. Get to learn how to write some code before embarking on a big project like this.

Thanks Mike,looks like I should make my own Infrared sensor to make life easier.