Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: direct pin access

  1. #1

    direct pin access

    I want to toggle directly the LED pin (pin 13) without using any library routines or any predifined constants. Has someone an example? Is it right that the pin13-toggle is on port 401B8000+4000+8C on the Teensy 40 and is bit 3 ? But the following code does not work

    Code:
    void loop() {
      gpio_adr1=0x401b8000+0x4000+0x8c ;
      *gpio_adr1=0x8 ;
      delay(250) ; 
       gpio_adr1=0x401b8000+0x4000+0x8c ;
      *gpio_adr1=0x0 ;
      delay(250) ; 
      }

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,082
    perhaps read this post for reference - port-and-toggle-question-T4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •