(Nordic) BLESetup call causes digitalWrite(LED_BUILTIN, HIGH) to stop working


  • Full Member
  • ***
    • Posts: 14
    • View Profile
I've been using the "TinyShield_NRF8001_BLE_Example" project as a starting point for a new project.
I've added "assert" code with serial port output to verify that LED_BUILTIN is in fact pin13 in my build.
I've also put pinMode(LED_BUILTIN, OUTPUT) in my Setup method.   If I replace my "loop" method with
the simple "blink led" using digitalWrite and delays, it works fine UNLESS I make a call to BLEsetup() in
my Setup() method!   I have looked at UART.h (which is where BLEsetup is apparently defined) and I don't
see any "pin" definitions or anything that would seem to conflict with pin 13 being used for the processor
board's LED.
 A side note: looking at what appears to be the Tiny's processor board schematic on that page's link, "SCK"
is marked as the driver of the LED; "SCK" on the chip is pin 17.   Since I *know* that pin 13 works correctly
(per the "assert(LED_BUILTIN == 13)" not failing in my code), I can only conclude the schematic may be wrong.
   Anyone have thoughts on this one?
Thanks very much!

Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 390
    • View Profile
Sorry about the slow response. 'SCK' is the SPI clock pin, which is Arduino pin 13 and used with the Nordic TinyShield. The processor pin numbering is separate and abstracted from in the Arduino environment. Unfortunately the 'pin 13 LED' thing is one of those Arduino quirks that we're more or less stuck with on the ATmega328p based boards for compatibility, so the built in LED cannot be used normally when SPI is used.


SMF spam blocked by CleanTalk