Software Archive
Read-only legacy content
17060 Discussions

Correction to Digital IO Example

toadaze
Beginner
320 Views

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)

0 Kudos
1 Reply
Matthias_H_Intel
Employee
320 Views

thanks!

0 Kudos
Reply