Giter Club home page Giter Club logo

utils's Introduction

utils

various scripts

led_brightness_pwm_table_gen

shell script that generates a brightness-to-duty-cyle table for LEDs utilizing Weber-Fechner's law of perception

Usage: led_brightness_pwm_table_gen [-c] [-i<indent>] [-n<num-coeff>] <steps> [<resolution>]
    -c, --ctable       c mode: output table in c syntax
    -i, --indent       indent to use for c mode (default: tab)
    -n, --number       number of coefficients per line in c mode (default: 8)
    -h, --help         show this help screen
    -l, --low-active   GPIO is low active

steps         number of table entries (e.g. 32)
resolution    PWM resolution (default: 65535)

See Weber-Fechner law for brightness perception.

Examples:
    $ led_brightness_pwm_table_gen -c 32
    $ led_brightness_pwm_table_gen 8 10000

Examples:

$ ./led_brightness_pwm_table_gen -c 32
#define LED_MAX_BRIGHTNESS 31

// generated by: led_brightness_pwm_table_gen -c 32
static const uint16_t led_pwm_table[LED_MAX_BRIGHTNESS + 1] = {
        0, 1, 2, 3, 4, 6, 9, 12,
        17, 25, 36, 51, 73, 105, 150, 214,
        306, 438, 626, 895, 1281, 1831, 2619, 3746,
        5357, 7660, 10955, 15667, 22406, 32043, 45825, 65535,
};

$ ./led_brightness_pwm_table_gen 8 10000
0
4
14
52
193
720
2683
10000


$ ./led_brightness_pwm_table_gen -l 8 10000
10000
9996
9986
9948
9807
9280
7317
0

terminal

shell script that implements a serial terminal based only on standard tools like cat, stty, etc. and does everything that's needed for remote access to Embedded Linux etc. and more.

Usage:
    terminal [device:/dev/ttyUSB0 [baudrate:115200]]
    terminal {--help|-h}
  • Public Domain -- do with it what you want, extend, sell, whatever
  • can replace minicom, picocom, screen with under 250 lines of bash
  • no ncurses or windows, just regular console with whatever backlog the terminal offers
  • logging simply by tee-ing into a file
  • supports break signal (Linux SysRq!) even over USB/serial
  • has time synchronization short cut: you can set the local time on a remote Linux system where you are logged in (using date and hwclock)
  • easy to extend
  • can run scripts (but doesn't have "expect" functionality, so you need to work with delays)

tree.sh

Simple tree implementation that also works with the busybox shell if you replace '#!/bin/bash' with '#!/bin/sh'.

  • Supports only graphcial UTF characters for tree lines.
  • Implements only two of tree's options:
    • --all/-a
    • --level/-L
  • Adds one option that tree doesn't have:
    • --dump/-z -- output contents of each file. This is particularly useful for showing contents of sysfs files.

utils's People

Contributors

drehscheibe avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.