sound dial tone.bs2 - 'What's a...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
'What's a Microcontroller-firstprogram.bs2 'BASIC Stamp sends message to Debug Terminal ' {$STAMP BS2} ' {$PBASIC 2.5} ' ======================================================================== ' Program... SOUNDS.BS2 ' Author .... Robert Jordan (modified by Jon Williams) ' Started... 03 SEP 2000 ' Updated... 07 SEP 2000 ' ======================================================================== ' -----[ Program Description ]-------------------------------------------- ' ' This program demonstrates the versatility of the Stamp 2 FREQOUT ' command. ' -----[ Revision History ]----------------------------------------------- ' ' -----[ I/O Definitions ]------------------------------------------------ ' Spkr CON 15 ' speaker port ' -----[ Constants ]------------------------------------------------------ ' R CON 0 ' rest C CON 33 ' ideal is 32.703 Cs CON 35 ' ideal is 34.648 D CON 37 ' ideal is 36.708 Ds CON 39 ' ideal is 38.891 E CON 41 ' ideal is 41.203 F CON 44 ' ideal is 43.654 Fs CON 46 ' ideal is 46.249 G CON 49 ' ideal is 48.999 Gs CON 52 ' ideal is 51.913 A CON 55 ' ideal is 55.000 As CON 58 ' ideal is 58.270 B CON 62 ' ideal is 61.735 N1 CON 500 ' whole note N2 CON N1/2 ' half note N3 CON N1/3 ' third note N4 CON N1/4 ' quarter note N8 CON N1/8 ' eighth note ' -----[ Variables ]------------------------------------------------------ ' x VAR Word ' loop counter note1 VAR Word ' first tone for FREQOUT note2 VAR Word ' second tone for FREQOUT dur VAR Word ' duration for FREQOUT oct1 VAR Nib ' octave for freq1 (1 - 8) oct2 VAR Nib ' octave for freq2 (1 - 8) ee VAR Byte ' EEPROM pointer digit VAR Byte ' DTMF digit clkDly VAR Word ' delay betweens "clicks"
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern