miércoles, 4 de enero de 2017

Programming A Musical Picaxe



Use picaxe to produce some tunes is a fun and entertaining tool. My first melodies were Christmas and the source code is in Basic.

Hardware

Chip-08 M2 differs from PICAXE-08 that comes in its internal code implemented a number of additional commands, also has the possibility of using interrupts, control commands servos, reading infrared sensors and temperature.



The Programming Editor application has a wizard to create a melody code designed personally or loading an already or import existing monophonic ringtone for mobile. These ringtones are widely available on the Internet at RTTL format. Only it works on the PICAXE-08M and this can only play one note at a time (monophonic) not allowing the use of polyphonic sounds.

Circuit Diagram


Software

To program the integrated circuit you must use the Picaxe programming editor. Once we loaded the melody we can change. The output set in the micro to play sounds is the output2, but you can also select another exit to accompany the melody with flashes of a LED. You can download songs from the website of Picaxe.

Code


'Silent Night 1
tune B.2, 6,($27,$69,$27,$E4,$27,$69,$27,$E4,$C2,$02,$EB,$C0,$00,$E7,$E9,$29,$00,$6B,$29,$27,$69,$27,$E4,$E9,$29,$00,$6B,$29,$27,$69,$27,$E4,$C2,$02,$05,$42,$2B,$C0,$C4,$00,$27,$24,$27,$65,$22,$E0)
'Rudolph the red nosed reindeer
 pause 1000
tune 2, 7,($4C,$68,$6A,$68,$65,$41,$6A,$28,$68,$6A,$68,$6A,$68,$41,$C0,$66,$68,$66,$63,$40,$6A,$28,$68,$6A,$68,$6A,$68,$6A,$E5,$68,$6A,$6A,$65,$41,$6A,$28,$68,$6A,$68,$6A,$68,$41,$C0,$66,$68,$66,$63,$40,$6A,$28,$68,$6A,$68,$6A,$68,$43,$C1)
 pause 1000
 'Jingle Bells 3
tune 2, 6,($67,$44,$42,$40,$E7,$67,$44,$42,$40,$E9,$69,$45,$44,$42,$6B,$67,$6B,$42,$47,$47,$45,$42,$C4,$67,$44,$42,$40,$E7,$66,$67,$44,$42,$40,$E9,$69,$45,$44,$42,$47,$47,$46,$47,$46,$47,$48,$49,$47,$44,$42,$00,$07,$44,$44,$44,$43,$44,$44,$44,$43,$44,$47,$40,$42,$C4,$45,$45,$45,$45,$45,$44,$44,$44,$44,$44,$42,$42,$44,$C2)

https://www.amazon.com/Guillermo%20Perez/e/B01EZOTUVQ/

guillengap@gmail.com

No hay comentarios:

Publicar un comentario