/// <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; }
/// <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 static void setv(int socket, int pin, int v) { AnalogOutput ao = new AnalogOutput((Cpu.AnalogOutputChannel)pin); ao.WriteRaw(v); }
public override void Dispose() { this._port.Dispose(); this._port = null; }