diff --git a/examples/basic_usage.py b/examples/basic_usage.py index d1c67e1..e1fe858 100644 --- a/examples/basic_usage.py +++ b/examples/basic_usage.py @@ -6,10 +6,12 @@ logging.basicConfig(level=logging.DEBUG) k = eSSP.NV11() k.sync() +k.host_protocol_version(6) k.set_channel_inhibits(0xff, 0xff) k.enable() k.display_on() +print k.channel_values() while True: events = k.poll() diff --git a/examples/float_demo.py b/examples/float_demo.py new file mode 100644 index 0000000..ca7a73a --- /dev/null +++ b/examples/float_demo.py @@ -0,0 +1,41 @@ +import time +import eSSP + +acceptor = eSSP.NV11() +acceptor.sync() +print 'First poll:', acceptor.poll() +acceptor.host_protocol_version(6) +acceptor.set_channel_inhibits(0xff, 0xff) +acceptor.set_value_reporting_type(1) + +print 'Current route for 0x02 channel is %r. Setting to 0x00 (payout)' % ( + acceptor.get_denomination_route(0x02),) +acceptor.set_denomination_route(0x00, 0x02) + +print 'Trying to payout single note...' +try: + acceptor.payout_note() +except Exception as exc: + print 'Failed (%r)' % exc + +acceptor.enable() +acceptor.display_on() + +while True: + events = acceptor.poll() + + if events: + print events + + for evt in events: + if evt.code == 239 and evt.args[0] != 0: + print 'You may reject a note of type %r here now...' % evt.args[0] + # ...like this: + # acceptor.reject_banknote() + if evt.code == 219: + print 'Current payout state: %r' % acceptor.get_note_positions() + if evt.code == 210: + print 'Disabled, enabling...' + acceptor.enable() + + time.sleep(0.5)