74HC595_7segx2

Drive 2x 7segment displays with 2 x 74HC595
Author: Djeremaille
License:
Github: djrm/gpio/spi/74HC595_7segx2.axo

Inlets

int32 chain in i

Outlets

int32 out

frac32 out

Control Rate
int d1 = 0;
int d2 = 0;
int o1 = 0;
int o2 = 0;
d1 = inlet_in / 10;
if (d1 == 0)
  o1 = 0x3F;

if (d1 == 1)
  o1 = 0x6;

if (d1 == 2)
  o1 = 0x5B;

if (d1 == 3)
  o1 = 0x4F;

if (d1 == 4)
  o1 = 0x66;

if (d1 == 5)
  o1 = 0x6D;

if (d1 == 6)
  o1 = 0x7D;

if (d1 == 7)
  o1 = 0x7;

if (d1 == 8)
  o1 = 0x7F;

if (d1 == 9)
  o1 = 0x6F;

d2 = inlet_in - d1 * 10;
if (d2 == 0)
  o2 = 0x3F;

if (d2 == 1)
  o2 = 0x6;

if (d2 == 2)
  o2 = 0x5B;

if (d2 == 3)
  o2 = 0x4F;

if (d2 == 4)
  o2 = 0x66;

if (d2 == 5)
  o2 = 0x6D;

if (d2 == 6)
  o2 = 0x7D;

if (d2 == 7)
  o2 = 0x7;

if (d2 == 8)
  o2 = 0x7F;

if (d2 == 9)
  o2 = 0x6F;

outlet_outf = o1 | (o2 << 8);
outlet_outi = outlet_outf;

Privacy

© 2024 Zrna Research