{"id":16616750,"url":"https://github.com/stecman/avr-flight-fuel-timer","last_synced_at":"2025-10-14T08:38:02.155Z","repository":{"id":66224495,"uuid":"82277166","full_name":"stecman/avr-flight-fuel-timer","owner":"stecman","description":"An unnecessarily fancy countdown timer for keeping track of fuel in light aircraft","archived":false,"fork":false,"pushed_at":"2021-02-26T22:24:54.000Z","size":1076,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T19:43:22.686Z","etag":null,"topics":["atmel","aviation","avr","c","flight","fuel","microcontroller"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stecman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-17T08:53:46.000Z","updated_at":"2021-02-26T22:24:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"a2818fc5-697d-4d7d-8554-631eeb3a9fa7","html_url":"https://github.com/stecman/avr-flight-fuel-timer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecman%2Favr-flight-fuel-timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecman%2Favr-flight-fuel-timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecman%2Favr-flight-fuel-timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stecman%2Favr-flight-fuel-timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stecman","download_url":"https://codeload.github.com/stecman/avr-flight-fuel-timer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242967742,"owners_count":20214281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atmel","aviation","avr","c","flight","fuel","microcontroller"],"created_at":"2024-10-12T02:14:07.762Z","updated_at":"2025-10-14T08:37:57.110Z","avatar_url":"https://github.com/stecman.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Light Aircraft Fuel Timer\n\nThis is a small (completely overkill) embedded project for monitoring fuel while\nflying small aircraft like the Cessna 172, Piper Warrior, etc. It's currently\nwritten against the Atmel AVR ATMega328P microcontroller, though the plan is to\neventually use the ATXMega128D4.\n\nI have some practical use for this, but it's mostly an experiment in how much UI\ncan be crammed onto a medium-sized 8-bit micro.\n\nMore project info can be found on [the project page on Hackaday.io](https://hackaday.io/project/19903-light-aircraft-fuel-timer).\n\n## Building\n\nThis project is set up for develop on Linux and OSX. It can probably be made to\nwork under AVR Studio on Windows with some work. It currently needs to be built\nusing `-std=gnu99`. The target is expected to run at 16MHz, but `CLOCK` can be\nconfigured in the Makefile to whatever suits your fuses.\n\nOn a Debian-based Linux distro:\n\n```sh\n# Install build and flashing tools\nsudo apt-get install gcc-avr avrdude binutils-avr\n\n# Install Python if you don't already have it for some reason\nsudo apt-get install python python-pip\n\n# Install the PyYAML module (required for some code generation)\npip install pyyaml\n\n# Build the project\nmake\n```\n\nThe test suite can be run using:\n\n```sh\n# Grab testing library\ngit submodule init\ngit submodule update\n\n# Run tests\nmake test\n```\n\n### Flashing a device\n\n`avrdude` options for your programmer can be specified with `PROGRAMMER`:\n\n```sh\n# Flash a device connected via serial with an Arudino bootloader\nmake flash PROGRAMMER=\"-c arduino -P /dev/ttyUSB0 -b57600\"\n\n# Flash with an AVR Dragon programmer in ISP mode\nmake flash PROGRAMMER=\"dragon_isp\"\n```\n\n## Notes for users\n\n- Fuel and fuel burn per hour are represented as whole integers. Partly because\n  this device is for approximation, and partly because the precision of a fuel\n  tank dipstick or a \"fuel burn per hour\" average/max is unlikely to be greater\n  than whole numbers.\n\n  If you want better accuracy, get avionics that have a digital fuel flow meter\n  and fuel level sensors that can work out your actual burn and endurance.\n\n## Developer notes\n\n- Strings are stored in `PROGMEM` (`__flash` under `gnu99`). These are defined in\n  `text.yml` and turned  into C header and source files during build, as the C code\n  to ensure reuse of strings in flash is verbose and repetitive.\n\n- There is no dynamic allocation in this project. This design choice is partly\n  to avoid hard to reproduce bugs that are possible with heap allocation on\n  microcontrollers, and partly as a fun challenge.\n\n- State exists statically in a few places (eg. `system.c`). Global variables\n  are avoided in favour of private state with an exposed interface. Functionality\n  is defined independently of this state where possible (eg. `eventloop.h`).\n\n- An event loop is currently used to handle user input. This is an experiment\n  and is a bit limited (no arguments, small event queue, etc). Not entirely sure\n  this is appropriate for an embedded device, but it's nice to work with for now.\n\n- This is my first pure C project. There may be oddities because of this -\n  feedback is appreciated.\n\n## Schematics / hardware\n\nDetails coming in future on how to put this circuit/device together. Currently\nthis is sitting on a breadboard on my desk.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstecman%2Favr-flight-fuel-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstecman%2Favr-flight-fuel-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstecman%2Favr-flight-fuel-timer/lists"}