Browse Source

Fix lints

pull/137/head
Andrea Ciliberti 1 year ago
parent
commit
fdd836ba9d
  1. 2
      ctru-rs/examples/buttons.rs
  2. 2
      ctru-rs/examples/camera-image.rs
  3. 6
      ctru-rs/examples/movement.rs

2
ctru-rs/examples/buttons.rs

@ -28,7 +28,7 @@ fn main() { @@ -28,7 +28,7 @@ fn main() {
// Print the status of the volume slider.
println!(
"\x1b[20;0HVolume slider: {} ",
hid.slider_volume()
hid.volume_slider()
);
// We only want to print when the keys we're holding now are different

2
ctru-rs/examples/camera-image.rs

@ -76,7 +76,7 @@ fn main() { @@ -76,7 +76,7 @@ fn main() {
if keys_down.contains(KeyPad::R) {
println!("Capturing new image");
let mut camera = &mut cam.both_outer_cams;
let camera = &mut cam.both_outer_cams;
// Take a picture and write it to the buffer.
camera

6
ctru-rs/examples/movement.rs

@ -19,8 +19,8 @@ fn main() { @@ -19,8 +19,8 @@ fn main() {
// Activate the accelerometer and the gyroscope.
// Because of the complex nature of the movement sensors, they aren't activated by default with the `Hid` service.
// However, they can simply be turned on and off whenever necessary.
hid.enable_accelerometer();
hid.enable_gyroscope();
hid.set_accelerometer(true);
hid.set_gyroscope(true);
while apt.main_loop() {
// Scan all the controller inputs.
@ -35,10 +35,12 @@ fn main() { @@ -35,10 +35,12 @@ fn main() {
println!(
"\x1b[3;0HAcceleration: {:?} ",
hid.accelerometer_vector()
.expect("could not retrieve acceleration vector")
);
println!(
"\x1b[4;0HGyroscope angular rate: {:?} ",
hid.gyroscope_rate()
.expect("could not retrieve angular rate")
);
gfx.wait_for_vblank();

Loading…
Cancel
Save