added the serial library

This commit is contained in:
ZennDev1337 2023-09-20 16:39:36 +02:00
parent 65db708e61
commit 5dbe66e910
8 changed files with 235 additions and 1 deletions

View file

@ -7,7 +7,13 @@ use arduboy_rust::prelude::*;
#[allow(dead_code)]
const arduboy: Arduboy2 = Arduboy2::new();
extern "C" {
#[link_name = "arduino_serial_begin"]
fn serial_begin(serial: c_ulong);
// #[link_name = "arduino_serial_println_chars"]
// fn serial_println_chars(cstr: *const c_char);
}
// Progmem data
// dynamic ram variables
@ -19,6 +25,7 @@ pub unsafe extern "C" fn setup() {
arduboy.begin();
arduboy.set_frame_rate(30);
arduboy.clear();
serial_begin(9600)
}
// The loop() function repeats forever after setup() is done
@ -29,5 +36,7 @@ pub unsafe extern "C" fn loop_() {
if !arduboy.next_frame() {
return;
}
serial::print("velo\0");
//serial_println_chars(b"hallo\0" as *const [u8] as *const i8);
arduboy.display();
}