No direct experience of SPI but commented on the issue. Setting pinMode was critical in some stuff I was doing. In your code you are referencing the pin (in the pinMode argument) as numeric '13' versus 'D13'. I referenced with the letter prefix.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
No direct experience of SPI but commented on the issue. Setting pinMode was critical in some stuff I was doing. In your code you are referencing the pin (in the pinMode argument) as numeric '13' versus 'D13'. I referenced with the letter prefix.