void Initialize() { var onboardLed = new RgbPwmLed( device: Device, redPwmPin: Device.Pins.OnboardLedRed, greenPwmPin: Device.Pins.OnboardLedGreen, bluePwmPin: Device.Pins.OnboardLedBlue); onboardLed.SetColor(Color.Red); var i2CBus = Device.CreateI2cBus(); radio = new Tea5767(i2CBus); var display = new Ssd1306(i2CBus, 60, Ssd1306.DisplayType.OLED128x32); graphics = new MicroGraphics(display); graphics.Rotation = RotationType._180Degrees; btnNext = new PushButton(Device, Device.Pins.D03); btnNext.Clicked += BtnNextClicked; btnPrevious = new PushButton(Device, Device.Pins.D04); btnPrevious.Clicked += BtnPreviousClicked; onboardLed.SetColor(Color.Green); }
public MeadowApp() { Console.WriteLine("Initializing..."); radio = new Tea5767(Device.CreateI2cBus()); Scan(); }
static void Main(string[] args) { I2cConnectionSettings settings = new I2cConnectionSettings(1, Tea5767.DefaultI2cAddress); I2cDevice device = I2cDevice.Create(settings); using (Tea5767 radio = new Tea5767(device, FrequencyRange.Other, 103.3)) { Console.ReadKey(); } }
void InitializePeripherals() { var led = new RgbLed(Device, Device.Pins.OnboardLedRed, Device.Pins.OnboardLedGreen, Device.Pins.OnboardLedBlue); led.SetColor(RgbLed.Colors.Red); var i2CBus = Device.CreateI2cBus(); radio = new Tea5767(i2CBus); display = new Ssd1306(i2CBus, 60, Ssd1306.DisplayType.OLED128x32); graphics = new GraphicsLibrary(display); graphics.Rotation = GraphicsLibrary.RotationType._180Degrees; btnNext = new PushButton(Device, Device.Pins.D03, ResistorMode.InternalPullUp); btnNext.Clicked += BtnNextClicked; btnPrevious = new PushButton(Device, Device.Pins.D04, ResistorMode.InternalPullUp); btnPrevious.Clicked += BtnPreviousClicked; led.SetColor(RgbLed.Colors.Green); }