Add wiring pi (for test and doc)
This commit is contained in:
parent
e157a5d02d
commit
53c6fcd917
4 changed files with 29 additions and 0 deletions
src
|
@ -8,6 +8,7 @@ extern crate core;
|
|||
use actix_web::{middleware, web, App, HttpServer};
|
||||
use actix_web::middleware::normalize::TrailingSlash;
|
||||
use env_logger::{Builder, Env};
|
||||
use wiringpi::pin::Value::High;
|
||||
|
||||
mod db;
|
||||
mod handlers;
|
||||
|
@ -20,6 +21,12 @@ async fn main() -> std::io::Result<()> {
|
|||
|
||||
Builder::from_env(Env::default().default_filter_or("info")).init();
|
||||
|
||||
let pi = wiringpi::setup();
|
||||
|
||||
//Use WiringPi pin 0 as output
|
||||
let pin = pi.output_pin(0);
|
||||
pin.digital_write(High);
|
||||
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.wrap(middleware::DefaultHeaders::new()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue