Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. not get GPIO pulse
Forum Updated to NodeBB v4.3 + New Features

not get GPIO pulse

Scheduled Pinned Locked Moved Unsolved QtonPi
2 Posts 2 Posters 939 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    carter_james
    wrote on last edited by carter_james
    #1

    hello everybody i try to
    generatea GPIO pulse signal but i dont get any signal an oscilloscope.i use raspberryPi2 als controller
    my code

    #define PIN RPI_BPLUS_GPIO_J8_11
    if (!bcm2835_init())
    {
    qDebug() << "error during initialisation of library"
    }
    else

    {
    
        bcm2835_gpio_fsel(PIN, BCM2835_GPIO_FSEL_OUTP) //set pin to output
        bcm2835_gpio_clr(PIN);// set pin to low
    
         {    for(int i=0; i<5;i++)//5 perioden
                           
                     bcm2835_gpio_write(PIN, HIGH)// pin auf 1
                     bcm2835_delay(500);    //wait 0.5s
                     bcm2835_gpio_write(PIN, LOW);//pin auf 0
                     bcm2835_delay(500);//wait 0.5
         }
    

    }

    1 Reply Last reply
    0
    • yeckelY Offline
      yeckelY Offline
      yeckel
      wrote on last edited by
      #2

      Hi are you getting any error? And are you running the code as root? (sudo ./a.out) Try pasting your code. Examples from http://www.effusiontech.com/how-to-blink-led-in-raspberry-pi-using-c-language.html is working fine.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved