<s> """<STR_LIT>""" <EOL> from bbio import * <EOL> from bbio . libraries . EventIO import * <EOL> sw1 = GPIO1_7 <EOL> sw2 = GPIO1_3 <EOL> pot = AIN0 <EOL> event_loop = EventLoop ( ) <EOL> def event1 ( ) : <EOL> toggle ( USR1 ) <EOL> return EVENT_CONTINUE <EOL> def event2 ( ) : <EOL> toggle ( USR2 ) <EOL> return EVENT_CONTINUE <EOL> def event3 ( ) : <EOL> digitalWrite ( USR3 , HIGH ) <EOL> return EVENT_CONTINUE <EOL> def event4 ( ) : <EOL> digitalWrite ( USR3 , LOW ) <EOL> return EVENT_CONTINUE <EOL> def setup ( ) : <EOL> event_loop . add_event ( DigitalTrigger ( sw1 , HIGH , event1 , <NUM_LIT:50> ) ) <EOL> event_loop . add_event ( DigitalTrigger ( sw2 , HIGH , event2 , <NUM_LIT> ) ) <EOL> event_loop . add_event ( AnalogLevel ( pot , <NUM_LIT> , event3 ) ) <EOL> event_loop . add_event ( AnalogLevel ( pot , <NUM_LIT> , event4 , direction = - <NUM_LIT:1> ) ) <EOL> event_loop . start ( ) <EOL> def loop ( ) : <EOL> print "<STR_LIT>" % int ( millis ( ) ) <EOL> delay ( <NUM_LIT> ) <EOL> run ( setup , loop ) </s>
