Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Volti.cpp
- Committer:
- Digitalesavanzados
- Date:
- 2016-08-20
- Revision:
- 0:d994dd919d32
File content as of revision 0:d994dd919d32:
#include "Volti.h"
int x,y,z, unim=0, deco[10]= {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67};
double x1,x2,ent;
void voltime::configout(PinName a,PinName b,PinName c,PinName d,PinName e,PinName f,PinName g, PinName p, PinName kuni, PinName kdec,PinName kcen,PinName kunim)
{
_a=a;
_b=b;
_c=c;
_d=d;
_e=e;
_f=f;
_g=g;
_p=p;
_kuni=kuni;
_kdec=kdec;
_kcen=kcen;
_kunim=kunim;
}
void voltime::vol(double ent)
{
BusOut disp(_a,_b,_c,_d,_e,_f,_g);
DigitalOut p=_p;
DigitalOut kuni=_kuni;
DigitalOut kdec=_kdec;
DigitalOut kcen=_kcen;
DigitalOut kunim=_kunim;
ent = ent * 0.000050354;
x = ent;
x1 = ent - x;
x2 = x1 * 100;
y = x2 / 10;
z = x2 - (y*10);
disp=deco[x];
kcen=1;
p=1;
wait(0.007);
kcen=0;
p=0;
disp=deco[y];
kdec=1;
wait(0.007);
kdec=0;
disp=deco[z];
kuni=1;
wait(0.007);
kuni=0;
disp=deco[unim];
kunim=1;
wait(0.007);
kunim=0;
}