Part 2: Welcome TI-Innovator – Playing with sound

  • Instructions - How you can control built-in speaker?
  • Controlling build-in speaker

    Define sound()=
    Prgm
    Send "SET SOUND 440 TIME 2"
    EndPrgm

    Where 440 is frequency and 2 is time.

    Write the code and test that it is working right.

    N_aytt_okuva 2017-03-19 kello 10.32.42

  • Exercise - Sound frequency

    Your work

    Write a program that it ask a frequency and then it gives the sound

     

    You may need

    • Request command 
    • eval command

    Extra for experts 

    Think how you can limit that the frequency is not too low or too high?

  • Solutions

    TI-Basic Code

    Define sound()=
    Prgm
    Request "Frequency",f
    Send "SET SOUND eval(f) TIME 2"
    EndPrgm

    Notice: You can't copy-paste it because it includes HTML formattings

    TI-Basic Code with min&max

    Define sound()=
    Prgm
    Request "Frequency",f
    Send "SET SOUND eval(min({max({f,50}),1000})) TIME 2"
    EndPrgm