IR Obstacle Sensor Coding Problem

hello, I am new to Arduino, I was Looking to make an obstacle avoider/line follower robo using arduino and IR OBSTACLE SENSOR.

I bought a couple of digital ir obstacle sensor, and tried to test them,,, I made a simple code and uploaded it to the arduino,.

the basic logic is, when obstacle is there, the led will blink and serial monior will show :- "obstacle"... otherwise the serial monitor will show:-"go",,,,,,,

when I uploaded the code the led was blinking, but there was no message shown in the serial monitor. Also when I tried using it on the robo, only the line next to the "if statement" is executed.

Can you please tell me what the problem is the code:-

int irpin=7;
int led=13;
int obs=HIGH;

void setup()
void loop()
Serial.println("obstacle");// this line does not executes
Serial.println("go");//this line does not executes

code is OK. Add 'serial.begin(your speed)' in setup