Beispiel #1
0
        public static void Main()
        {
            int channel = 0, position = 0;
            int delta = 1;
            AD5206 ad5206 = new AD5206(Pins.GPIO_PIN_D10);

            ad5206.SetWiper(channel, 0);
            Thread.Sleep(5000);
            ad5206.SetWiper(channel, 255);
            Thread.Sleep(5000);

            while (true)
            {
                Debug.Print("Position: " + position);
                ad5206.SetWiper(channel, position);
                position += delta;

                if (position >= 255 || position == 0)
                {
                    delta = delta * -1;
                }

                Thread.Sleep(100);
            }
        }
Beispiel #2
0
        private void InitIndicators()
        {
            outputs = new Hashtable();

            AD5206[] ad5206 = new AD5206[] { new AD5206(Outputs.CS1), new AD5206(Outputs.CS2) };

            byte device = 0;
            byte channel = 0;

            foreach (string server in SERVERS)
            {
                outputs.Add(server, new Indicator(new AD5206_Channel(ad5206[device], channel++), DECAY_FACTOR));
                if (channel > 5)
                {
                    channel = 0;
                    device++;
                }
            }
        }
Beispiel #3
0
 public AD5206_Channel(AD5206 output, byte channel)
 {
     this.Output = output;
     this.Channel = channel;
 }