<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=51306211" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zpw199062">@zpw199062</a> it's very hard to follow your code. Next time, please prepare a tested clean version that you share. However, your <code>main()</code> should be relatively simple. Initialize one pin as interrupt pin that triggers on rising edge. When this occurs, the callback you passed during initialization will be called. In there, you can increment your counter. Please refer to <a href="https://riot-os.org/api/group__drivers__periph__gpio.html#ga48ba4c318486db320a4bf6237b49d61c" rel="nofollow"><code>gpio_init_int()</code></a>. I recommend to grep through the RIOT code base if it's not clear how to use that function. Also <em>tests/periph_gpio</em> implements it, but it has all the overhead of the shell parsing...</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/issues/11669?email_source=notifications&email_token=ABE7WYG6MXWAJCUZSAE26ELP3CF5TA5CNFSM4HW2OXR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX5PETA#issuecomment-502985292">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYDHLS4P6WIYWYBJMGLP3CF5TANCNFSM4HW2OXRQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYCW2XFC4OTGKDNMTXTP3CF5TA5CNFSM4HW2OXR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX5PETA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/issues/11669?email_source=notifications\u0026email_token=ABE7WYG6MXWAJCUZSAE26ELP3CF5TA5CNFSM4HW2OXR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX5PETA#issuecomment-502985292",
"url": "https://github.com/RIOT-OS/RIOT/issues/11669?email_source=notifications\u0026email_token=ABE7WYG6MXWAJCUZSAE26ELP3CF5TA5CNFSM4HW2OXR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX5PETA#issuecomment-502985292",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>