mdowds95 / EE312

0 stars 0 forks source link

lab4 main testv1 #5

Open mdowds95 opened 8 years ago

mdowds95 commented 8 years ago

hile(1) { ADC_startConversion(ADC_BASE, ADC_SINGLECHANNEL); switch(even_in_range(P1IV,P1IV_P1IFG7)) { case P1IV_P1IFG3: //It is SW1 SW1interruptFlag = 1;//interrupt sw1 cannot equal interrupt sw1 1 after it is pressed (False to True, True to False) GPIO_clearInterrupt(GPIO_PORT_P1, GPIO_PIN3); break; } switch(even_in_range(ADCIV,ADCIV_ADCIFG)) { case ADCIVADCIFG: speedvalue= ADC_getResults( ADC_BASE); break; }

if(SW1interruptFlag == 1) dialValue = (dialValue<<1) | (dialValue>>7); //clockwise

else dialValue = (dialValue>>1) | (dialValue<<7); //anticlockwise

//while(GPIO_getInputPinValue(GPIO_PORT_P1, GPIO_PIN3) == 0) //{ //to correct bouncing //}

/*if(SW2interruptFlag == 0)//first option/speed speedvalue_ = 25;

else if(SW2interruptFlag == 1)//second option/speed speedvalue_ = 15;

else if(SW2interruptFlag == 2)//third option/speed speedvalue_ = 5; */

//Set value setLedDial(dialValue);

for(i=0; i < speedvalue_/10; i++)//run through each i value to change speed refreshLedDial();