int sweepfwd[] = {60,80,80,90,90,90}; int sweepaft[] = {90,90,90,80,80,60}; int heaveup[] = {180,180,180,180,180,180}; int heavedn[] = {160,160,160,160,160,160}; #include SoftwareSerial mySerial(9, 10); // RX, TX void flashLEDs(int i,int j,int k) { i = abs(i-1); j = abs(j-1); delay(100); digitalWrite(7,HIGH); digitalWrite(8,HIGH); delay(100); digitalWrite(7,i); digitalWrite(8,j); } void commandLeg(String commandString) { flashLEDs(0,1); mySerial.println(commandString); flashLEDs(1,0); delay(100); } void setup() { // set the data rate for the SoftwareSerial port mySerial.begin(1200); pinMode(7,OUTPUT); pinMode(8,OUTPUT); String commandString = "N8 speak 006"; commandLeg(commandString); } void loop() { // run over and over int leg=0; String commandString; if (count>999) count=0; commandString = "N8 place 107"; // position cursor line 1, cell 7 commandLeg(commandString); delay(50); commandString = "N8 count " + String(count); // string to be printed is a number commandLeg(commandString); count++; commandString = "N7 heave 140"; commandLeg(commandString); delay(1000); commandString = "N7 sweep 100"; commandLeg(commandString); delay(1000); commandString = "N7 sweep 80"; commandLeg(commandString); delay(1000); }