Tones project

wovop

New member
An apology had been published in another section of the forum.

Hi good day.
Greetings, I am new to this.
I need help. I am developing a project.
It is a tone system that when pressing a switch, develops a tone and when releasing it develops another tone. I have already done this, but I need that with two other switches I can select different types of tones, previously saved in the picaxe. that's where I don't know how to do it. If you can guide me how to do it, thank you in advance.

Code:
main:

let dirsC = 5

high C.1

if pinC.1=0 then

end if


high C.0

pause 500

; Please paste tune below this line...

tune 0, 1, ($52,$5C,$52)


if pinC.1=1 then


end if


high C.0


; Please paste tune below this line...

tune 0, 1, ($9C,$9C,$43,$56)


low C.0


goto main
 

1968neil

Senior Member
This sounds like you are trying to make a "Roger Beep" or end of transmission Tone project ? With selectable tones ?
Is this correct or am i reading into the request too deeply ?
If this is the case then i have a finished project that you might find will do the job............
or at least give you the right tools to achieve and understand the coding required ?
 

Technical

Technical Support
Staff member
You need to read all the inputs into a variable, mask off the inputs you are interested in, and then test those inputs like this (example uses C.0 and C.1)

Code:
let b1 = pinsC & %00000011  ; mask off pins C.0 and C.1 into variable b1

if b1 = %00000000 then
   tune....
elseif b1 = %00000001 then
   tune....
elseif b1 = %00000010 then
   tune....
elseif b1 = %00000011 then
   tune....
end if
 
Top