//TABS SUBROUTINE
mainPanel.add(tabs, BorderLayout.CENTER);
tabs.addTab("Manual Control", main);
// tabs.addTab("Control", new JTextArea());
tabs.addTab("Robot Location", autonomous);
tabs.addTab("Status", new JScrollPane(list));
setContentPane(mainPanel);
pack();
}
/************** PATTERN 1 (SOME RANDOM TEST PATTERN ) ***************************/
/* This function sends the commands to move through pattern1 */
public void doPattern1()
{
leftMotor.setValue(FORWARD);
rightMotor.setValue(FORWARD);
try {
// 1000 milliseconds == one second
Thread.sleep(3000);
} catch (InterruptedException e){}
leftMotor.setValue(FORWARD);
rightMotor.setValue(REVERSE);
try {
Thread.sleep(3000);
} catch (InterruptedException e){}
leftMotor.setValue(STOP);
rightMotor.setValue(FORWARD);
try {
Thread.sleep(3000);
} catch (InterruptedException e){}
leftMotor.setValue(REVERSE);
rightMotor.setValue(STOP);
try {
Thread.sleep(3000);
} catch (InterruptedException e){}
leftMotor.setValue(FORWARD);
rightMotor.setValue(FORWARD);
try {
Thread.sleep(3000);
Komentarze do niniejszej Instrukcji