Esempio n. 1
0
		/// <summary>
		/// Turns on the buzzer.
		/// </summary>
        public static void StartBuzzer()
        {
            if (!Sound.IsEnabled)
                throw new Exception("You must enable Sound first.");

            if (AudioSwitch == null)
            {
                AudioSwitch = new AnalogOutput(Cpu.AnalogOutputChannel.ANALOG_OUTPUT_0, 12);
                AudioSwitch.Write(0);
            }

            Sound.PWMOut.Start();
        }
 public override void Dispose()
 {
     _port.Dispose();
     _port = null;
 }
Esempio n. 3
0
		/// <summary>
		/// Turns off the buzzer.
		/// </summary>
		public static void StopBuzzer()
		{
			if (!Sound.IsEnabled)
				throw new Exception("You must enable Sound first.");

            Sound.PWMOut.Stop();

            if (AudioSwitch != null)
            {
                AudioSwitch.Dispose();
                AudioSwitch = null;
            }
			
		}
 public override void Dispose()
 {
     _port.Dispose();
     _port = null;
 }
Esempio n. 5
0
		public static void setv(int socket, int pin, int v) {
			AnalogOutput ao = new AnalogOutput((Cpu.AnalogOutputChannel)pin);
			ao.WriteRaw(v);
		}
Esempio n. 6
0
 public override void Dispose()
 {
     this._port.Dispose();
     this._port = null;
 }