Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

SDK • how use gpio delay time microseconds ?

$
0
0
Hi, I would use gpio for drive coil, I need speed up clock 500 hz.
this is example 500hz, i test with my multimeter fluk:

Code:

#include "pico/stdlib.h"int main() {    const uint LED_PIN = 0; // GPIO25    gpio_init(LED_PIN);    gpio_set_dir(LED_PIN, GPIO_OUT);    while (true) {        gpio_put(LED_PIN, 1);        sleep_ms(1);        gpio_put(LED_PIN, 0);        sleep_ms(1);    }}
gpio_put() set parameter INT , how I can't use microseconds or nano seconde because milliseconde is to long time ?
for example i would like generate 10khz in gpio out 0, I use pico2
thank's for reply :)

Statistics: Posted by keokod — Sat Nov 30, 2024 1:20 pm



Viewing all articles
Browse latest Browse all 4906

Trending Articles