hello to every one,here is Yangyang.I want to know,how can test the polling-frequency of I/O-port on beaglebone black,and what is the maximum speed of the frequency ? The max. speed what I test is around 27kHz. Hope there is anyone can help me
contact via ahfycyy@gmail.com. Thanks.
Here is my code(python):
from bbio import *
import time
testIO = GPIO1_28 #P9_12
testVar = 0
counter = 0
cntMax = 10000
startTiME = time.time()
endTiME = 0
pinMode(testIO, INPUT)
while 1:
if counter >= cntMax:
endTiME = time.time()
print ‘Frequenz an test IO:’, cntMax / (endTiME - startTiME)
counter = 0
startTiME = time.time()
else:
if not digitalRead(testIO) == testVar:
testVar = not testVar
counter += 1