/* * Final Project: Micro mouse, CS154 Spring 2001 * Name : SooYoung Jung * Date : April, 11, 2001 * File : mm.cc */ /* motor */ int RM = 0; int LM = 1; /* IR sensor */ int IR1 = 0; /* Back */ int IR2 = 1; /* Right */ int IR3 = 2; /* Front */ int IR4 = 3; /* Left */ /* 90 deg right turn : 5 {lego0_counts = 0; while(lego0_counts > -5) {motor(0, -100); motor(1, 100);} ao();} 18cm : 10 {lego0_counts = 0; while(lego0_counts < 10) {motor(0, 100); motor(1, 100);} ao();} */ void main() { sleep(2.0); motor(0, 100); motor(1, 100); sleep(0.75); motor(0, 100); motor(1, 100); sleep(0.75); motor(0, -100); motor(1, 100); sleep(0.32); motor(0, 100); motor(1, 100); sleep(0.75); motor(0, -100); motor(1, 100); sleep(0.32); motor(0, -100); motor(1, 100); sleep(0.32); motor(0, 100); motor(1, 100); sleep(0.75); motor(0, -100); motor(1, 100); sleep(0.32); motor(0, 100); motor(1, 100); sleep(0.75); motor(0, 100); motor(1, 100); sleep(0.75); motor(0, 100); motor(1, -100); sleep(0.32); motor(0, 100); motor(1, -100); sleep(0.32); ao(); }