This commit is contained in:
flo66 2017-01-12 21:58:03 +01:00
parent 254ae1aab2
commit a81f124774
2 changed files with 10 additions and 8 deletions

0
PWM echantillonage Normal file
View File

View File

@ -23,13 +23,15 @@ void switchStatePin()
}
}*/
const char* bincod = "111010001100100011101" ;
const char* bincod = "111011001000100011101" ;
unsigned char range = 0;
void lect440()
{
if(bincod[range+1] != bincod[range])
// range = (range < 20 ? range +1 : 0);
if(bincod[range] != bincod[range+1])
{
if(isSH3())
{
@ -40,6 +42,7 @@ void lect440()
*(volatile unsigned char*)SH7305_PJDR ^= 0x04;
}
}
range = (range < 19 ? range +1 : 0);
}
@ -48,7 +51,7 @@ int main(void)
{
unsigned int key=0;
int freq = 220;
int freq = 1;
//unsigned int i=0;
@ -58,12 +61,11 @@ int main(void)
{
dclear();
dprint(1, 1, "%d", freq);
range = (range < 20 ? range +1 : 0);
// dprint(1, 1, "%d", freq);
// PrintMini(1, 1, itoa(freq, str, 10), 0);
dprint(1, 10, "%d", !isSH3());
// dprint(1, 10, "%d", !isSH3());
//dprint(1,20, "%c , %c", bincod[range], bincod[range+1]);
// dprint(1, 20, "%d", range);
//PrintMini(1, 10, itoa(is_SH4, str, 10), 0);
@ -79,7 +81,7 @@ range = (range < 20 ? range +1 : 0);
case KEY_DOWN : freq-=10; break;
case KEY_EXE :
timer_start(TIMER_USER, freq, Clock_Hz, lect440, 0);
timer_start(TIMER_USER, 8800, Clock_Hz, lect440, 0);
break;
case KEY_EXIT :