Herunterladen Inhalt Inhalt Diese Seite drucken

SunFounder Da Vinci Kit Bedienungsanleitung Seite 110

Für den raspberry pi 4 modell b, 3 modell a +, 3 modell b +, 3 modell b, 2 modell b, 1 modell b +, 1 modell a +, zero w and zero
Inhaltsverzeichnis

Werbung

SunFounder Da Vinci Kit
#define
CM1
262
#define
CM2
294
#define
CM3
330
#define
CM4
350
#define
CM5
393
#define
CM6
441
#define
CM7
495
#define
CH1
525
#define
CH2
589
#define
CH3
661
#define
CH4
700
#define
CH5
786
#define
CH6
882
#define
CH7
990
int
song_1[]
=
{CM3,CM5,CM6,CM3,CM2,CM3,CM5,CM6,CH1,CM6,CM5,CM1,CM3,CM2,
CM2,CM3,CM5,CM2,CM3,CM3,CL6,CL6,CL6,CM1,CM2,CM3,CM2,CL7,
CL6,CM1,CL5};
int
beat_1[]
=
{1,1,3,1,1,3,1,1,1,1,1,1,1,1,3,1,1,3,1,1,1,1,1,1,1,2,1,1,
1,1,1,1,1,1,3};
int
song_2[]
=
{CM1,CM1,CM1,CL5,CM3,CM3,CM3,CM1,CM1,CM3,CM5,CM5,CM4,CM3,CM2,
CM2,CM3,CM4,CM4,CM3,CM2,CM3,CM1,CM1,CM3,CM2,CL5,CL7,CM2,CM1
};
int
beat_2[]
=
{1,1,1,3,1,1,1,3,1,1,1,1,1,1,3,1,1,1,2,1,1,1,3,1,1,1,3,3,2,3};
int
main(void)
{
int
i, j;
if(wiringPiSetup()
printf("setup wiringPi failed
return
1;
}
if(softToneCreate(BuzPin)
printf("setup softTone failed
return
1;
}
while(1){
printf("music is being
delay(100);
for(i=0;i<sizeof(song_1)/4;i++){
softToneWrite(BuzPin, song_1[i]);
delay(beat_1[i]
}
for(i=0;i<sizeof(song_2)/4;i++){
softToneWrite(BuzPin, song_2[i]);
delay(beat_2[i]
}
}
106
==
-1){
//when initialize wiring failed,print message to screen
!");
==
-1){
!");
played...\n");
500);
*
500);
*
(Fortsetzung der vorherigen Seite)
(Fortsetzung auf der nächsten Seite)
Kapitel 1. Über das Da Vinci Kit

Werbung

Inhaltsverzeichnis
loading

Verwandte Produkte für SunFounder Da Vinci Kit

Diese Anleitung auch für:

Davinci-kit-for-raspberry-pi

Inhaltsverzeichnis