Main Site Documentation

Problem with piezo



i’m trying to execute this code (from

using System;
using Microsoft.SPOT;
using System.Threading;
using GHIElectronics.NETMF.FEZ;
public class Program
public static void Main()
// Create Piezo (speaker) object assigned to the a Peizo Component connected to Di5 with PWM feature
FEZ_Components.Piezo myPiezo = new FEZ_Components.Piezo(FEZ_Pin.PWM.Di5);
// Play a 4kHz. tune for 5 Seconds
myPiezo.Play(4000, 3000);
// Play sequencial tunes
int[] freq = new int[] { 2000, 3000, 4000, 5000 };
int[] duration = new int[] { 200, 100, 200, 100 };
while (true)
myPiezo.Play(freq, duration);

it compiles without errors, but when i try to run it say’s

[quote]The program ‘[5] Micro Framework application: Managed’ has exited with code 0 (0x0).

without doing anything.

any suggestions?

have a nice day


You need to update your firmware and see this too:


Also see the big red “ALERT” on the right side on this website :slight_smile:


chimp, I do not think it’s visible enough.

Maybe we should get a big flashing banner! B)


thank your very much

it worked

have a nice day