Cleanup code and add simple README

This commit is contained in:
Marco Thomas
2022-04-18 13:19:17 +02:00
parent d5de0d3db6
commit 89dbe4adca
6 changed files with 88 additions and 32 deletions

View File

@@ -1,11 +1,29 @@
#+TITLE: bad-apple-embedded-rs
#+html: <p align="center" width="300"><img src="assets/bad_apple.jpg" /></p>
Why? Because I wanted to and because Rust rocks!
* Features
This project was built using an =STM32-F303ZE= with a simple =ssd1306= OLED display.
It draws 21x10 with (almost perfectly) stable 8 frames per second and
was designed and built to play Bad Apple, but anything else would also work.
Frame timings and length of the video can be adjusted, too high frames per second can lead to slowed down playback due to the render time being larger than the desired one.
Faster render times are being adjusted for.
* How to use
1. Convert a video to an ASCII file, using =video-to-ascii.py=
2. Adjust frame timing in the main program (draw time per picture, width, height, total frames)
3. Flash and enjoy!
* Input format
The screen renders video through ASCII characters. It takes in a long text file, containing all the images in a contiguous stream, which is then read in =IMAGE_LEN=-sized (height * width + newline chars) chunks in the main program.
If these parameters don't match up, the end result won't either.
* Dependencies
The video-to-ascii conversion script uses [[https://github.com/ivanl-exe/image-to-ascii/][image-to-ascii]] for the conversion in the background.
The =video-to-ascii.py= conversion script uses [[https://github.com/ivanl-exe/image-to-ascii/][image-to-ascii]] for the conversion in the background.
It is assumed to be located on the same height as this project and that it is build in release-mode (due to performance).
* TODO
- [ ] Add README Stuff
- [ ] Rewrite ascii conversion in Rust (with an own impl of ascii-to-text)
- [ ] Fix timing in draw
- [ ] Rewrite ascii conversion in Rust or Haskell (with an own implementation of =ascii-to-text=)