public static void Test() { DS3232Connection d = new DS3232Connection(); TimeOscillator t = new TimeOscillator(d); bool b = t.Stopped; }
public SquareOscillator(DS3232Connection d) { // MASK should be a constant -- how to do this? MASK = (byte)(Utility.mask_byte((int)ControlBits.SQW_Freq_Bit_01) | Utility.mask_byte((int)ControlBits.SQW_Freq_Bit_00)); _ds3232 = d; _frequency = GetFrequency(); }
public Thermometer(DS3232Connection d) { this._ds3232 = d; // initialize temp to 0x00 this._tempMSB = 0x00; this._tempLSB = 0x00; this._temperature = 0x00; }
public static void Memory() { DS3232Connection ds3232 = new DS3232Connection(); Memory m = new Memory(ds3232); // Memory map before byte[] dump = m.Dump(); m.DeleteMemory(); // Memory map after dump = m.Dump(); }
public TimeOscillator(DS3232Connection d) { this._ds3232 = d; }
public static void Thermometer() { DS3232Connection ds3232 = new DS3232Connection(); Thermometer t = new Thermometer(ds3232); while (true) { Debug.Print(t.Temperature.ToString()); Thread.Sleep(1000); //Thread.Sleep(64000); // Every 64 seconds poll for value } }
public static void SquareWave() { DS3232Connection ds3232 = new DS3232Connection(); SquareOscillator sqw = new SquareOscillator(ds3232); InputPort i = new InputPort(Pins.GPIO_PIN_D0, false, Port.ResistorMode.PullUp); OutputPort o = new OutputPort(Pins.ONBOARD_LED, false); sqw.EnableOnBattery(); sqw.SetFrequency((int)SQWFrequencyCode.SQW_1_Hz); sqw.Start(); int times = 0; while (times < 500) { o.Write(i.Read()); Thread.Sleep(10); times++; } sqw.Stop(); sqw.DisableOnBattery(); o.Write(false); }
public Memory(DS3232Connection d) { this._ds3232 = d; }
public Oscillator32KHz(DS3232Connection d) { this._ds3232 = d; }
public Clock(DS3232Connection d) { this._ds3232 = d; }