Skip to content

Instantly share code, notes, and snippets.

@asciant
Created June 12, 2016 23:42
Show Gist options
  • Select an option

  • Save asciant/a0c1d9c1084f0be0b4f35624d0c6cd71 to your computer and use it in GitHub Desktop.

Select an option

Save asciant/a0c1d9c1084f0be0b4f35624d0c6cd71 to your computer and use it in GitHub Desktop.

Revisions

  1. asciant created this gist Jun 12, 2016.
    14 changes: 14 additions & 0 deletions basic.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/bin/bash

    while true;

    do

    i2cget -y 1 0x48 0x00 w |
    awk '{printf("%.1f\n", (a=( \
    (("0x"substr($1,5,2)substr($1,3,1))*0.0625)+0.1) \
    )>128?a-256:a)}'

    sleep 3

    done