public MeadowApp() { Console.WriteLine("Initializing..."); var spiBus = Device.CreateSpiBus(24000); display = new Ili9341 ( device: Device, spiBus: spiBus, chipSelectPin: Device.Pins.D13, dcPin: Device.Pins.D14, resetPin: Device.Pins.D15, width: 240, height: 320 ); graphics = new GraphicsLibrary(display); int delay = 5000; while (true) { JpegTest(); Thread.Sleep(delay); CharacterTest(); Thread.Sleep(delay); DrawMeadowLogo(); Thread.Sleep(delay); FontTest(); Thread.Sleep(delay); TestDisplay(); Thread.Sleep(delay); TestDisplay(); } }
void Initialize() { Console.WriteLine("Initialize hardware..."); onboardLed = new RgbPwmLed(device: Device, redPwmPin: Device.Pins.OnboardLedRed, greenPwmPin: Device.Pins.OnboardLedGreen, bluePwmPin: Device.Pins.OnboardLedBlue, 3.3f, 3.3f, 3.3f, Meadow.Peripherals.Leds.IRgbLed.CommonType.CommonAnode); Console.WriteLine("Init camera"); camera = new Vc0706(Device, Device.SerialPortNames.Com4, 38400); Console.WriteLine("Create Spi bus"); var config = new SpiClockConfiguration(24000, SpiClockConfiguration.Mode.Mode0); var spiBus = Device.CreateSpiBus(Device.Pins.SCK, Device.Pins.MOSI, Device.Pins.MISO, config); Console.WriteLine("Create display driver instance"); display = new Ili9341 ( device: Device, spiBus: spiBus, chipSelectPin: Device.Pins.D13, dcPin: Device.Pins.D14, resetPin: Device.Pins.D15, width: 240, height: 320 ); Console.WriteLine("Create graphics lib"); graphics = new GraphicsLibrary(display); graphics.CurrentFont = new Font12x20(); Console.WriteLine("Init complete"); }