Exemple #1
0
void TC6014_Config()
{
	AXIS_InitTypeDef AXIS_InitStruct;
	Drive_InitTypeDef Drive_InitStruct;
	//
	Set_Axis(AXIS_ALL);
	//
	AXIS_InitStruct.Dir_Level = LOW;
	AXIS_InitStruct.Logic_Level = LOW;
	AXIS_InitStruct.Pulse_Mode = DIR_PULSE;
	AXIS_InitStruct.MLimit_Level = LOW;
	AXIS_InitStruct.PLimit_Level = LOW;
	AXIS_InitStruct.Stop_Mode = SUD_STOP;
	
	AXIS_Init(AXIS_InitStruct);
	//
	Drive_InitStruct.Range = 8000000;
	Drive_InitStruct.Acce = 5;
	Drive_InitStruct.Dece = 5;
	Drive_InitStruct.Acce_Rate = 10;
	Drive_InitStruct.Dece_Rate = 10;
	Drive_InitStruct.Init_Speed = 0;
	Drive_InitStruct.Speed = 500;
	Drive_InitStruct.Acce_Offset = 0;
	Drive_InitStruct.Man_Dece_Pos = 0;
	
	Drive_Init(Drive_InitStruct);
}
Exemple #2
0
char main(){
    int i;
    SERIAL_Init();
    INTEnableSystemMultiVectoredInt();
    Drive_Init();
    dbprintf("\nHello World");
    AD_Init(BAT_VOLTAGE);
    LED_Init(LED_BANK3);
    LED_OffBank(LED_BANK3, 0xf);
    wait();
    int pwm;

    while(1) {
        //Drive_Stop();
        wait();
        //Drive_Forward(MIN_SPEED);
        printf("\nFORWARD! speed=%u pwm=%u", motorSpeed[A], motorPWMValue[A]);
        //for (i = 0; i < 100; i++)
        //    wait();
        Drive_Stop();
        Drive_Pivot(left, 1);
        for (i = 0; i < 1; i++)
            wait();
        Drive_Stop();
        Drive_Pivot(right, 1);
        for (i = 0; i < 1; i++)
            wait();
        Drive_Stop();
        for (i = 0; i < 1; i++)
            wait();
    }
}
Exemple #3
0
void main(void)
{
	Sys_Init();
	putchar(' ');
	XBR0_Init();
	SMB_Init();
	PCA_Init();
	Drive_Init();
	Port_Init();
	ADC_Init();
	ranger_pd_init();
	//fan angle initialization code goes here
	
	while(1)
	{
		voltage_update();
		if(SS)
		{
			Range_Update(); //update the range
			Drive_Motor(ranger_pd());
		}
	else
		Drive_Motor(PW_NEUT); //if ss is not flipped, put it in neutral

	}
}
Exemple #4
0
int main()
{
    WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

    Clock_Init(0,0,0,1); // 1M DCO
    Drive_Init(0, 100);

    LCD5110_Init();
    LCD5110_Write_String(0,0,LCD_BUFFER1);
    _EINT();
    while(1)
    {
        if(SPEED_DISPLAY_FLAG == 1)
        {
            SPEED_DISPLAY_FLAG = 0;

            SPEED_L = Drive_Speed_L();
            SPEED_R = Drive_Speed_R();
            LCD5110_Long2char(SPEED_L / 5);
            LCD5110_Write_String(0,1,LCD5110_BUFFER);
            LCD5110_Long2char(SPEED_R / 5);
            LCD5110_Write_String(0,2,LCD5110_BUFFER);
        }
    }
}
Exemple #5
0
Fichier : api.c Projet : el303/pses
void api_init(void) {
	CILCR_LVL = 0;
	interrupts_init();

	// button
	PIER07_IE0 = 1;
	PIER07_IE1 = 1;
	PIER07 |= 0x0c;
	PUCR07 |= 0x0c;

	Sema = 0;
	vSemaphoreCreateBinary(Sema);

	//Seg_Init();
	Drive_Init();

	//FRAM_Init();

	Us_Init();
	//CarId_Init();
	ADC_Init();
	Battery_Init();
	Linesensor_Init();

	//wirelessInit();

	Serial_Init();

	__EI();
}
Exemple #6
0
/**
 * Initialize is run immediately when the robot is powered on
 * regardless of the field mode.
 */
void Initialize(void) {
	// This seems to make reading from the serial port work, even though it is
	// supposed to be opened automatically.
	OpenSerialPortOne(BAUD_115200);

	// Initialize subsystems
	Drive_Init();
	Sweeper_Init();
	Lifter_Init();
}
Exemple #7
0
void main(void)
{
	ES_Return_t ErrorType;
	BOARD_Init();
	// When doing testing, it is useful to annouce just which program
	// is running.

	printf("Starting the Exit HSM Test Harness \r\n");
	printf("using the 2nd Generation Events & Services Framework\n\r");

	// Your hardware initialization function calls go here
	Bot_Init();
	Drive_Init();

	// now initialize the Events and Services Framework and start it running
	ErrorType = ES_Initialize();

	if (ErrorType == Success) {
		ErrorType = ES_Run();
	}

	//
	//if we got to here, there was an error
	//

	switch (ErrorType) {
	case FailedPointer:
		printf("Failed on NULL pointer");
		break;
	case FailedInit:
		printf("Failed Initialization");
		break;
	default:
		printf("Other Failure");
		break;
	}

	while (1) {
		;
	}
}