CCS den protona çeviri yapmak?

Başlatan AKP, 26 Haziran 2009, 01:30:57

AKP

aşağıdaki "happy birthday" kodunu protona çevirmek istiyorum yardımcı olabilirmisiniz?

yada

bu melodiyi protonda baştan yapmalıyım yol gösterirmisiniz.

#if defined(__PCM__)
#include <16F877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)

#elif defined(__PCH__)
#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#endif

#include <tones.c>

#define SIZE 25

const struct note
{
   long tone;
   long length;
} happy_bday[SIZE] = {
C_note[0],350, C_note[0],100, D_note[0],500, C_note[0],500, F_note[0],500, E_note[0],900,
C_note[0],350, C_note[0],100, D_note[0],500, C_note[0],500, G_note[0],500, F_note[0],900,
C_note[0],350, C_note[0],100, C_note[1],500, A_note[0],500, F_note[0],500, E_note[0],500, D_note[0],900,
Bb_note[0],350, Bb_note[0],100, A_note[0],500, F_note[0],500, G_note[0],500, F_note[0],1200};


void main(void)  {
   int i;

   while(TRUE)
   {
      for(i=0; i<SIZE; ++i)
      {
         generate_tone(happy_bday[i].tone,happy_bday[i].length);
         delay_ms(75);
      }
   }
}

Maxim

sanırım #include <tones.c>
satırındaki kodlarda gerekir

Maxim

protonun örnekleri arasında bu var ,belki işe yarar

' Play 5 tunes depending on which key is pressed
		
		Include "PROTON_4.INC"
        
		Symbol  R	=	0
		Symbol	C	=	82
		Symbol  Db0	=	85
		Symbol	D	=	87
		Symbol  Eb	=	89
		Symbol  E	=	92
		Symbol  F	=	94
		Symbol  Gb	=	95
		Symbol  G	=	97
		Symbol	Ab1	=	99
		Symbol  A1	=	73
		Symbol  Bb1	=	76
		Symbol  BE1	=	79
		Symbol	C1	=	82
		Symbol  Db1	=	85
		Symbol	D1	=	87
		Symbol  Eb1	=	89
		Symbol  E1	=	92
		Symbol  F1	=	94
		Symbol  Gb1	=	95
		Symbol  G1	=	97
		Symbol	Ab2	=	99
		Symbol	A2	=	101
		Symbol	Bb2	=	102
		Symbol	BE2	=	104
		Symbol	C2	=	105
		Symbol	Db2	=	106
		Symbol	D2	=	108
		Symbol	E2	=	110
		Symbol	F2	=	111
		Symbol	Gb2	=	112
		Symbol	G2	=	113
		Symbol	Bb3	=	115
		Symbol	Bm3	=	116
		Symbol	C3	=	117
		Symbol	D3	=	118
		Symbol PIN = PORTA.0

	
START:	
		If InKey = 0 Then Song1		'Starwars
		If InKey = 1 Then Song2		'Death march 
		If InKey = 2 Then Song3		'Shave and a Haircut 
		If InKey = 3 Then Song4		'Charge!
		If InKey = 4 Then Song5		'Heart and Soul
        GoTo START
        
Song1:	Sound PIN,[G,80,D2,80,C2,20,BE2,20,A2,20,G2,80,D2,80,C2,20,BE2,20,A2,20,G2,80,D2,80,C2,20,BE2,20,C2,20,A2,80]
		GoTo START
Song2:	Sound PIN,[F,80,R,2,F,70,R,2,F,10,R,2,F,80,Ab1,60,R,2,G,10,R,2,G,60,R,5,F,10,R,2,F,50,R,2,E,20,R,1,F,40]
		GoTo START
Song3:	Sound PIN,[F2,40,R,2,C2,20,R,2,C2,20,R,5,D2,50,R,3,C2,30,R,40,E2,40,F2,50]
		GoTo START
Song4:	Sound PIN,[Db2,20,Gb2,20,Bb3,15,C3,30,R,5,Bb3,20,C3,75]
		GoTo START
Song5:	Sound PIN,[C2,30,R,10,C2,30,R,10,C2,80,R,3,C2,20,BE2,30,A2,20,BE2,30,C2,20,D2,30,R,5,C2,10,E2,30,R,15,E2,30,R,15,E2,80]
		GoTo START


AKP

örnekler için teşekkür ederim aslında en önemlisi kodu kendim yazmam yanlız bu müzik notalarını nasıl çıkarıyoruz bir programa ihtiyacım varmı?

protonun örneklerine nasıl erişiyoruz?