Пример #1
0
int main()
{
	OrangutanBuzzer::play(">>a16");
	delay(500); // warming up

	lcd.initPrintf();

	lcd.print("Assert");
	assert(1 == 1); // make sure assert works

	test_qtr();
	test_analog();
	test_pushbuttons();
	test_buzzer();
	test_motors();
	test_lcd();
	test_leds();
	test_delay();

	lcd.clear();
	lcd.print("Success");
	
	buzzer.play("O5 c16");

	return 0;
}
Пример #2
0
int main()
{
	delay_ms(500); // warming up

	lcd_init_printf();

	printf("\nAssert");
	assert(1 == 1); // make sure assert works

	test_qtr();
	test_pushbuttons();
	test_buzzer();
	test_motors();
	test_lcd();
	test_leds();
	test_analog();
	test_delay();

	clear();
	printf("\nSuccess");
	play("O5 c16");
	
	while(1);
}
Пример #3
0
int
main(int ac, char**av)
{
        int retValue = 0;

        bool option_test_leds = false;
        bool option_test_cnc = false;
        bool option_test_cnc_pulse = false;
        bool option_run_assembler_file = false;

        // Default frequency
        char* frequency = "1";
        char* fileName = NULL;

        if (ac == 1) {
  	    usage();
            return 1;
        }

        if (strcmp("test_leds", av[1]) == 0) {
	  option_test_leds = true;
        } 
	else if (strcmp("test_cnc", av[1]) == 0) {
	  option_test_cnc = true;
	}
	else if (strcmp("test_cnc_pulse", av[1]) == 0) {
          if (ac >= 3) {
	      frequency = av[2];
          }
	  option_test_cnc_pulse = true;

          printf("test_cnc_pulse: using frequency=%s\n", frequency);
	}
	else if (strcmp("run_assembler_file", av[1]) == 0) {
          if (ac >= 3) {
	      fileName = av[2];
          }
	  option_run_assembler_file = true;

          printf("run_assembler_file %s\n", fileName);
	}
	else {
  	    printf("menlo_cnc_app [test_leds] | [test_cnc] [test_cnc_pulse] [frequency]\n");
            return 1;
	}

        // Setup the hardware
        setup_hardware();

        if (option_test_leds) {
            retValue = test_leds(ledpio_base_address);
        }

        if (option_test_cnc) {
            retValue = test_menlo_cnc(menlo_cnc_registers_base_address);
        }

        if (option_test_cnc_pulse) {
	   retValue = test_menlo_cnc_pulse(menlo_cnc_registers_base_address, frequency);
        }

        if (option_run_assembler_file) {
	   retValue = run_assembler_file(menlo_cnc_registers_base_address, fileName);
        }

        close_hardware();

	return( retValue );
}