Skip to content

Dajamante/asyncrab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embassy examples

TL;DR: Plug the stuff as per the figures and run:

cargo rb <demo>

With demo = buttons, gyro, qdec

Demo 1: buttons; board buttons and screen

The first example uses the nRF52840-DK and a TFT LCD Display (specs: 1.8 inch Color TFT LCD Display Module 128*160 Interface SPI Drive ST7735, can be bought at Amazon but really from anywhere.

You can move Ferris around with the buttons. It will appear on the other side of the screen if you scroll too long :)

Connections

Run the demo

$ cargo rb buttons

First video

https://vimeo.com/705697973

Demo 2: gyro; Accelerometer

The second example uses the same screen and board, and adds a MPU6050 accelerometer.

It has I2C and we use only the pins SDA, SCK, GND and VCC.

Ferris can be moved on the screen by tilting the accelerometer, and stops at the border of the screen.

That seems like a lot of cables but the important thing is that the accelerometer and the screen must share 5V and GND pins.

Run the demo

$ cargo rb gyro

Async driver

Check the async driver for this program!

Second video

https://vimeo.com/705697951

Demo 3: qdec; Rotary encoder

The third example uses the same screen and board, with a rotary encoder EC11.

It does not have a VDD pin because of how the rotary encoder works (it works as switches that shorts to GND, the other pulls to VDD).

In this demo, Ferris does not move but you can dim the screen with the encoder.

The rotary encoder and the screen must share the GND pin.

Run the demo

$ cargo rb qdec

Third video

https://vimeo.com/725265205

Make your own image

If you want to insert your own image, find a .png and convert with ImageMagick:

$ convert <your_image>.png -type truecolor -define bmp:subtype=RGB565 -depth 16 -strip -resize 86x64 <new_bmp>.bmp

Then replace your image in the code:

let raw_image: Bmp<Rgb565> =
 Bmp::from_slice(include_bytes!("../../assets/<new_bmp>.bmp")).unwrap();

About

Embassy tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published