Piezo on the Cerbot

Hello-

Has anyone tried different tones other than 1000 hertz setting for frequency that is in the example code?

I can’t get anything other than 1000 to play? The second parameter for duration works fine.

cerbotController.StartBuzzer(1000, 500); works but cerbotController.StartBuzzer(1500, 500); plays nothing. I tried different values higher and lower for frequency and nothings plays unless I set 1000.

Thanks!

Tom

We just tried to set the buzzer to frequencies between 10Hz and 25,000Hz and they all worked. Can you post a minimal test case that isn’t working so we can try and narrow it down?

Looks like I found a 2nd frequency that works, but it’s still not right.

From this code snippit:


            cerbotController.StartBuzzer(2000, 200);
            Thread.Sleep(1000);
            cerbotController.StartBuzzer(1000, 200);
            Thread.Sleep(1000);
            cerbotController.StartBuzzer(10, 200);
            Thread.Sleep(1000);
            cerbotController.StartBuzzer(1100, 200);
            Thread.Sleep(1000);
            cerbotController.StartBuzzer(5100, 200);
            Thread.Sleep(1000);

Results in only 2 beeps, one from the 1000, and one from the 5100 (I think).

A video of the output is here:

Thanks,

Tom

Can you post an entire program that exhibits the problem removing as much code as possible so that it still shows the problem? We are still not able to reproduce using the snippet you provided.

I created a new project with just this code. The result is the same. I’m guessing if you can not duplicate it must be my hardware.


using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;

using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;

namespace GadgeteerApp7
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing 
            their name followed by a period, e.g.  button.  or  camera.
            
            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>
            
            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/


            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");


            cerbotController.StartBuzzer(2000, 200);
            Thread.Sleep(1000);
            cerbotController.StartBuzzer(1000, 200);
            Thread.Sleep(1000);
            cerbotController.StartBuzzer(10, 200);
            Thread.Sleep(1000);
            cerbotController.StartBuzzer(1100, 200);
            Thread.Sleep(1000);
            cerbotController.StartBuzzer(5100, 200);
            Thread.Sleep(1000);



        }
    }
}

We’re still not able to reproduce. What firmware version are you running?

DeviceInfo:
HAL build info: 4.2.0.0, Copyright GHI Electronics, LLC
OEM Product codes (vendor, model, SKU): 255, 0, 65535
Serial Numbers (module, system):
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Solution Build Info: 4.2.5.0, Copyright (C) GHI Electronics, LLC
AppDomains:
default, id=1
Assemblies:
mscorlib,4.2.0.0
Microsoft.SPOT.Native,4.2.0.0
Microsoft.SPOT.Hardware,4.2.0.0
Microsoft.SPOT.Graphics,4.2.0.0
Microsoft.SPOT.TinyCore,4.2.0.0
Microsoft.SPOT.Hardware.SerialPort,4.2.0.0
Microsoft.SPOT.IO,4.2.0.0
System.IO,4.2.0.0
Microsoft.SPOT.Hardware.OneWire,4.2.0.0
Microsoft.SPOT.Hardware.Usb,4.2.0.0
System.Xml,4.2.0.0
Microsoft.SPOT.Hardware.PWM,4.2.0.1
Microsoft.SPOT.Net,4.2.0.0
System,4.2.0.0
Gadgeteer,2.42.0.0
GadgeteerApp7,1.0.0.0
GHI.OSHW.Hardware,4.2.5.0
Microsoft.SPOT.Touch,4.2.0.0
System.Http,4.2.0.0
System.Net.Security,4.2.0.0
GTM.GHIElectronics.CerbotController,1.0.0.0
Microsoft.SPOT.Net.Security,4.2.0.0
GHIElectronics.Gadgeteer.FEZCerbot,1.0.0.0

If you please, what versions and types are you running of the following software:

OS - Windows 7, Windows 8? 32 vs 64 bit?
Visual C# compiler - Express, professional, 2010, 2012?
Micro Framework - 4.2 QFE2? 4.3?
MFDeploy version

Win 8 64bit
VS 2012 Express
Microframework 4.3 RTM
MFDeploy 4.3.0.0

Thanks,

Tom

.NETMF 4.2, see picture.

Thanks!

Tom

We were able to reproduce the problem and we are looking into it.

1 Like

Thank you!

I guess a better question is - what is the frequency range supported? Is it really 10 - 25,000Hz ?

I did some more testing and I figured out one of my statements was not correct about a particular frequency that didn’t work. It wasn’t 5100 that worked, it was 1100.

I seem to be able to get values from 1000 - 1990 to work (see video). Above or below that, the Piezo just makes a brief “click”, you can hear it in the previous videos if you listen closely.

If this is supposed to be the range for that value, that’s fine, I’m just happy to get some variation. Is this the same hardware that’s used on the Tunes module? What’s the range of Tunes?

I just have seen piezo “music” published that in the 250-4000 hertz range that I was attempting to replicate and it seemed like “nothing” but 1000 was working, which I realize now is not true. I’m sorry If this is just normal behavior.

We have found the problem and it is fixed in the next SDK, you should have a much larger range now.

Do you know what range? When you say next SDK, do you mean the one that is coming out here shortly that supports the Game-O, or the one after that?

Thanks!

Tom

The SDK that is coming out shortly with support for GameO. I was able to get the piezo to produce sound from around 100Hz to 15,000Hz on the one I tested.

Sweet. Thank you all so much!