Switch Case for Self Docking Robot

Hi, I need my c code functions in Arduino,

typedef enum { Avoid, IR_detected, Stop, Charging_Start } stateMachine;
stateMachine simpleState = Avoid; //initialise statemachine

switch (simpleState)
{

case Avoid:

my first state is Avoid until robot detects ir signal.
Thanks

my first state is Avoid until robot detects ir signal.

What, exactly, is it the robot should avoid? Red meat and alcohol?

Hi, I am working on Self Recharging Robot which goes to Docking system when its battery charge is low. for that i am using one Ultrasonic Sensor on front of robot, to Avoid the obstacles, and 5 I.R sensors to locate Docking station which transmitting Infrared signal. When i turned the robot on it goes straight into AVOID state and Ultrasonic Sensor is functional. but when any of I.R receiver on robot receives Infrared signal the robot goes to State IR_detected and the it looks for front sensor to get Infrared signal. once it receives signal then it goes towards docking station and stop to charge itself

Thanks