/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/drawer.cc

  • Committer: edam
  • Date: 2012-02-25 14:54:33 UTC
  • Revision ID: edam@waxworlds.org-20120225145433-kih8qs45x05cum46
removed Bounce library and updated/fixed new code

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
void Drawer::draw_reset()
28
28
{
29
29
}
 
30
 
 
31
 
 
32
void Drawer::led_on( int led, bool on )
 
33
{
 
34
        if( led < 0 || led > 9 ) return;
 
35
 
 
36
        // convert to pin no.
 
37
        led += 4;
 
38
 
 
39
        // pin 4 needs to be inverted (it's driving a PNP)
 
40
        if( led == 4 ) on = !on;
 
41
 
 
42
        digitalWrite( led, on? HIGH : LOW );
 
43
}