Esempio n. 1
0
        public static void Main()
        {
            Debug.Print(Resources.GetString(Resources.StringResources.String1));

            var display = new PCD8544(chipSelectPin: Pins.GPIO_PIN_D9, dcPin: Pins.GPIO_PIN_D8,
                                      resetPin: Pins.GPIO_PIN_D10, spiModule: SPI.SPI_module.SPI1);

            gl             = new GraphicsLibrary(display);
            gl.CurrentFont = new Font8x8();

            InitGPS();

            Thread.Sleep(-1);
        }
        public MeadowApp()
        {
            Console.WriteLine("Initializing...");

            pCD8544 = new PCD8544
                      (
                device: Device,
                spiBus: Device.CreateSpiBus(),
                chipSelectPin: Device.Pins.D01,
                dcPin: Device.Pins.D00,
                resetPin: Device.Pins.D02
                      );

            graphics = new GraphicsLibrary(pCD8544);

            TestPCD8544();
        }
Esempio n. 3
0
        //hardware init
        private static void Initialize()
        {
            buttons[(int)SnakeDirection.Left]  = new PushButton(Pins.GPIO_PIN_D6, CircuitTerminationType.CommonGround);
            buttons[(int)SnakeDirection.Right] = new PushButton(Pins.GPIO_PIN_D4, CircuitTerminationType.CommonGround);
            buttons[(int)SnakeDirection.Up]    = new PushButton(Pins.GPIO_PIN_D5, CircuitTerminationType.CommonGround);
            buttons[(int)SnakeDirection.Down]  = new PushButton(Pins.GPIO_PIN_D7, CircuitTerminationType.CommonGround);

            buttons[(int)SnakeDirection.Left].Clicked  += LeftClicked;
            buttons[(int)SnakeDirection.Right].Clicked += RightClicked;
            buttons[(int)SnakeDirection.Up].Clicked    += (s, e) => game.Direction = SnakeDirection.Up;
            buttons[(int)SnakeDirection.Down].Clicked  += (s, e) => game.Direction = SnakeDirection.Down;

            speaker = new PiezoSpeaker(PWMChannel.PWM_4);

            var display = new PCD8544(chipSelectPin: Pins.GPIO_PIN_D9, dcPin: Pins.GPIO_PIN_D8,
                                      resetPin: Pins.GPIO_PIN_D10, spiModule: SPI.SPI_module.SPI1);

            graphics             = new GraphicsLibrary(display);
            graphics.CurrentFont = new Font8x8();
        }
Esempio n. 4
0
        public static void Main()
        {
            Debug.Print(Resources.GetString(Resources.StringResources.String1));

            var display = new PCD8544(chipSelectPin: Pins.GPIO_PIN_D9, dcPin: Pins.GPIO_PIN_D8,
                                      resetPin: Pins.GPIO_PIN_D10, spiModule: SPI.SPI_module.SPI1);

            var gl = new GraphicsLibrary(display);

            gl.CurrentFont = new Font8x8();
            gl.DrawText(0, 0, "PCD8544");
            gl.CurrentFont = new Font4x8();
            gl.DrawText(0, 10, "Nokia 3110 & 5110");

            gl.DrawRectangle(20, 20, 10, 10);

            gl.DrawCircle(60, 30, 12, true, false);

            gl.Show();

            Thread.Sleep(-1);
        }