Let's Make Robots!

Picaxe sound speaker

How I can get a same frequency sound with do_loop function

<!-- @page { margin: 0.79in } P { margin-bottom: 0.08in } -->

Hi,

I am a picaxe beginner, but I have a general idea how to make a program and electric circuit.



I want to control a speaker (on/off) using picaxe18m2.

In order to control it, B.0 and B.1 are assigned to receive signals from a PC.



The following is my code.

main:

if pinB.1 = 1 then start0

goto main

 

start0:
do
sound B.7,(100,100)
if pinB.0 = 1 then exit
loop
goto main