Browse Source

Merge pull request #27 from eriknyquist/master

Minor additions to example sketches for Arduino 101 compatibility
main
Paul Stoffregen 8 years ago
parent
commit
d9807bb70c
6 changed files with 27 additions and 0 deletions
  1. +5
    -0
      examples/CopyFromSD/CopyFromSD.ino
  2. +3
    -0
      examples/CopyFromSerial/CopyFromSerial.ino
  3. +5
    -0
      examples/EraseEverything/EraseEverything.ino
  4. +5
    -0
      examples/ListFiles/ListFiles.ino
  5. +4
    -0
      examples/MP3Player/MP3Player.ino
  6. +5
    -0
      examples/RawHardwareTest/RawHardwareTest.ino

+ 5
- 0
examples/CopyFromSD/CopyFromSD.ino View File



const int SDchipSelect = 4; // Audio Shield has SD card CS on pin 10 const int SDchipSelect = 4; // Audio Shield has SD card CS on pin 10
const int FlashChipSelect = 6; // digital pin for flash chip CS pin const int FlashChipSelect = 6; // digital pin for flash chip CS pin
// Uncomment this line if using the built-in SPI Flash device
// on an Arduino 101 board
//const int FlashChipSelect = 21;


void setup() { void setup() {
//uncomment these if using Teensy audio shield //uncomment these if using Teensy audio shield
//pinMode(4, INPUT_PULLUP); //pinMode(4, INPUT_PULLUP);
//pinMode(10, INPUT_PULLUP); //pinMode(10, INPUT_PULLUP);


Serial.begin(9600);

// wait up to 10 seconds for Arduino Serial Monitor // wait up to 10 seconds for Arduino Serial Monitor
unsigned long startMillis = millis(); unsigned long startMillis = millis();
while (!Serial && (millis() - startMillis < 10000)) ; while (!Serial && (millis() - startMillis < 10000)) ;

+ 3
- 0
examples/CopyFromSerial/CopyFromSerial.ino View File

#define MISO 12 #define MISO 12
#define SCK 14 #define SCK 14
#define CSPIN 6 #define CSPIN 6
// Uncomment this line if using the built-in SPI Flash device
// on an Arduino 101 board
//#define CSPIN 21


void setup(){ void setup(){
Serial.begin(9600); //Teensy serial is always at full USB speed and buffered... the baud rate here is required but ignored Serial.begin(9600); //Teensy serial is always at full USB speed and buffered... the baud rate here is required but ignored

+ 5
- 0
examples/EraseEverything/EraseEverything.ino View File

#include <SPI.h> #include <SPI.h>


const int FlashChipSelect = 6; // digital pin for flash chip CS pin const int FlashChipSelect = 6; // digital pin for flash chip CS pin
// Uncomment this line if using the built-in SPI Flash device
// on an Arduino 101 board
//const int FlashChipSelect = 21;


SerialFlashFile file; SerialFlashFile file;


//pinMode(4, INPUT_PULLUP); //pinMode(4, INPUT_PULLUP);
//pinMode(10, INPUT_PULLUP); //pinMode(10, INPUT_PULLUP);


Serial.begin(9600);

// wait up to 10 seconds for Arduino Serial Monitor // wait up to 10 seconds for Arduino Serial Monitor
unsigned long startMillis = millis(); unsigned long startMillis = millis();
while (!Serial && (millis() - startMillis < 10000)) ; while (!Serial && (millis() - startMillis < 10000)) ;

+ 5
- 0
examples/ListFiles/ListFiles.ino View File

#include <SPI.h> #include <SPI.h>


const int FlashChipSelect = 6; // digital pin for flash chip CS pin const int FlashChipSelect = 6; // digital pin for flash chip CS pin
// Uncomment this line if using the built-in SPI Flash device
// on an Arduino 101 board
//const int FlashChipSelect = 21;


void setup() { void setup() {
//uncomment these if using Teensy audio shield //uncomment these if using Teensy audio shield
//pinMode(4, INPUT_PULLUP); //pinMode(4, INPUT_PULLUP);
//pinMode(10, INPUT_PULLUP); //pinMode(10, INPUT_PULLUP);


Serial.begin(9600);

// wait for Arduino Serial Monitor // wait for Arduino Serial Monitor
while (!Serial) ; while (!Serial) ;
delay(100); delay(100);

+ 4
- 0
examples/MP3Player/MP3Player.ino View File



#define PROP_AMP_ENABLE 5 #define PROP_AMP_ENABLE 5
#define FLASH_CHIP_SELECT 6 #define FLASH_CHIP_SELECT 6
// Uncomment this line if using the built-in SPI Flash device
// on an Arduino 101 board
//#define FLASH_CHIP_SELECT 21


void setup() { void setup() {
Serial.begin(9600);
AudioMemory(8); //4 AudioMemory(8); //4
delay(2000); delay(2000);



+ 5
- 0
examples/RawHardwareTest/RawHardwareTest.ino View File

#include <SPI.h> #include <SPI.h>


const int FlashChipSelect = 6; // digital pin for flash chip CS pin const int FlashChipSelect = 6; // digital pin for flash chip CS pin
// Uncomment this line if using the built-in SPI Flash device
// on an Arduino 101 board
//const int FlashChipSelect = 21;


SerialFlashFile file; SerialFlashFile file;


//pinMode(4, INPUT_PULLUP); //pinMode(4, INPUT_PULLUP);
//pinMode(10, INPUT_PULLUP); //pinMode(10, INPUT_PULLUP);


Serial.begin(9600);

while (!Serial) ; while (!Serial) ;
delay(100); delay(100);



Loading…
Cancel
Save