Commit 3b65a1f1 authored by Astro's avatar Astro
Browse files

implement vibra

parent 16d5d0b1
......@@ -17,9 +17,11 @@ fn main() {
let b = Buttons::read();
if b.left_bottom() {
display.print(0, 60, b"LB\0", Color::red(), Color::black());
vibra::set(true);
}
if b.right_bottom() {
display.print(80, 60, b"RB\0", Color::red(), Color::black());
vibra::set(false);
}
if b.left_top() {
display.print(0, 10, b"LT\0", Color::red(), Color::black());
......@@ -30,7 +32,7 @@ fn main() {
if b.right_top() {
display.print(80, 30, b"Reset\0", Color::red(), Color::black());
}
writeln!(UART, "Light: {:?}\r", light.get());
writeln!(UART, "Light: {:?}\r", light.get()).unwrap();
display.update();
}
......
......@@ -71,6 +71,7 @@ pub mod uart;
pub const UART: uart::Uart = uart::Uart;
mod light_sensor;
pub use light_sensor::LightSensor;
pub mod vibra;
pub fn exit(ret: i32) -> ! {
unsafe {
......
use super::bindings::*;
pub fn set(status: bool) {
unsafe { epic_vibra_set(status.into()); }
}
pub fn vibrate(millis: i32) {
unsafe { epic_vibra_vibrate(millis); }
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment