1 Reply Latest reply on Mar 30, 2015 11:24 AM by ForumMigrationAdmin

    Correction to Digital IO Example

    ForumMigrationAdmin

      The Digital IO Example at https://software.intel.com/en-us/node/519984
      needs 3 correction to work.

      import pymraa
      import time

      gpioLed = pymraa.Gpio(2)
      gpioLed.dir(pymraa.DIR_OUT)

      ledState = True

      while True:
          gpioLed.write(1 if ledState else 0)
          ledState = not ledState
          time.sleep(1)

      Change to:

      import mraa
      import time

      gpioLed = mraa.Gpio(2)
      gpioLed.dir(mraa.DIR_OUT)

      ledState = True

      while True:
          gpioLed.write(1 if ledState else 0)
          ledState = not ledState
          time.sleep(1)