Beispiel #1
0
int main(void){
	//PLL_Init(); //16MHZ bus clock //when PLL is on, nothing works
	HeartBeat_Init();
	//SysTick_Init();
  PolledButtons_Init();       // initialize interrupts and ports
	DAC_Init(1024);							// initialize with command: Vout = Vref
//	DAC_Init(0x1000);                  // initialize with command: Vout = Vref
	//Timer0A_Init(dt[0]);
	Board_Init();		//Initalize the On Board Switches
	Switch_Init2(); //i used the board switches because our switches were doing the thing
							//where they worked for a bit then they stopped working again
	lenPush = 1;
	int instrument = 0;

			
			
	while(1){
		if(mode){
			resetSwitches();	
			
			if (instrument == 0){
				Music_Play(Wave[0], 32, strobePtr, 35);	
				instrument += 1;
			}
			else if (instrument == 1){
				Music_Play(Trumpet[0], 32, strobePtr, 35);
				instrument += 1;
			}
			else if (instrument == 2){
				Music_Play(Flute[0], 32, strobePtr, 35);
				instrument = 0;
			}
		}
		else if(play){
			resetSwitches();
			if (instrument == 0){
				Music_Play(Wave[0], 64, strobePtr, 35);		
			}
			if (instrument == 1){
				Music_Play(Trumpet[0], 32, strobePtr, 35);
			}
			if (instrument == 2){
				Music_Play(Flute[0], 32, strobePtr, 35);
			}
		}
	}
}
Beispiel #2
0
int main(void){
	HeartBeat_Init();
	DAC_Init(1024);							// initialize with command: Vout = Vref
	Timer0A_Init(dt[0]);
	LCD_Init();  
    // Initialize RNG
  Random_Init(121213);
    // Initialize touchscreen GPIO
  Touch_Init();
	//lenPush = 1;
  //for(i=0; i<50; i=i+1){
	InitializeBars();
  for(i=0; i<400; i=i+1){
	MovingColorBars();
	}
	for(i=0; i<400; i=i+1){
		DestabilizeBars();
	}
	for(i=0; i<350; i=i+1){
		FinishBars();
	}
	for(i=0; i<1000; i=i+1){
     Random4BPPTestSprite();
  }
	LCD_ColorFill(convertColor(0, 0, 0));
	Buttons_Init();
	play = 0;
	while(1){
			if (instrument == 0){
				Music_Play(Wave[0], 64, strobePtr, 35);		
			}
			if (instrument == 1){
				Music_Play(Trumpet[0], 32, strobePtr, 35);
			}
			if (instrument == 2){
				Music_Play(Flute[0], 32, strobePtr, 35);
			}
	}
}