/* * SPDX-License-Identifier: ISC * Copyright (c) 2020 Callum David O'Brien */ extern crate embedded_hal; extern crate xu4_hal; use embedded_hal::digital::v2::OutputPin; use std::{thread::sleep, time::Duration}; use xu4_hal::gpio as xu4; fn main() { let mut op = xu4::OutputPin::new(xu4::Chip::Gpa0, 2, xu4::Type::PushPull).unwrap(); let duration = Duration::from_millis(1000); loop { sleep(duration); op.set_high().unwrap(); sleep(duration); op.set_low().unwrap(); } }