Author Topic: Getting SPI to work  (Read 1387 times)

cpetito

  • Newbie
  • *
  • Posts: 22
Getting SPI to work
« on: February 11, 2016, 04:21:08 am »
I've been playing with the SPI on the OAK, but have been unable to get anything to work.

This started as an effort to get the OAK TFT SPI shield working with the Adafruit_ILI9341 library and esp8266 graphics example.

At this point all I'm trying to do is to see clock output on Pin 9 with what I believe is a bare bones SPI test program.  I'm using the SPI library that is in the packages\digistump\hardware\oak\0.9.2\libraries\SPI.

Any pointers, suggestions or working example code using SPI will be appreciated!

Code: [Select]
#include <SPI.h>

void setup() {
 
  pinMode(1, OUTPUT);
  SPI.begin ();
}

void loop() {

  digitalWrite(1, HIGH);  //trigger logic analyzer
 
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
  SPI.transfer(0xAA);
  SPI.endTransaction();
 
  digitalWrite(1, LOW);
  Particle.delay(100);
}