Skip to content

Commit 68e5047

Browse files
committed
Added keywords for new libraries, rearranged and modified Due and USB examples
Renamed Leonardo Only examples folder to USB. Modified keyboard and Mouse examples to indicate Due compatibility. Minor modifications to Due examples to conform with existing example sketches. Added keywords to for Audio, Scheduer, and USBHost libraries.
1 parent c97e362 commit 68e5047

File tree

17 files changed

+197
-452
lines changed

17 files changed

+197
-452
lines changed

build/shared/examples/09.USB(Leonardo)/Keyboard/KeyboardLogout/KeyboardLogout.ino

Lines changed: 0 additions & 95 deletions
This file was deleted.

build/shared/examples/09.USB(Leonardo)/Keyboard/KeyboardMessage/KeyboardMessage.ino renamed to build/shared/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*
22
Keyboard Button test
3+
4+
For Leonardo and Due boards only.
35
46
Sends a text string when a button is pressed.
57

build/shared/examples/09.USB(Leonardo)/Keyboard/KeyboardReprogram/KeyboardReprogram.ino renamed to build/shared/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
44
This sketch demonstrates the Keyboard library.
55
6+
For Leonardo and Due boards only.
7+
68
When you connect pin 2 to ground, it creates a new
79
window with a key combination (CTRL-N),
810
then types in the Blink sketch, then auto-formats the text

build/shared/examples/09.USB(Leonardo)/Keyboard/KeyboardSerial/KeyboardSerial.ino renamed to build/shared/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
Keyboard test
33
4+
For Leonardo and Due boards only
5+
46
Reads a byte from the serial port, sends a keystroke back.
57
The sent keystroke is one higher than what's received, e.g.
68
if you send a, you get b, send A you get B, and so forth.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
/*
33
KeyboardAndMouseControl
4+
5+
For Leonardo and Due boards only.
46
57
Controls the mouse from five pushbuttons on an Arduino Leonardo.
68

build/shared/examples/09.USB(Leonardo)/Mouse/ButtonMouseControl/ButtonMouseControl.ino renamed to build/shared/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

22
/*
33
ButtonMouseControl
4+
5+
For Leonardo and Due boards only.
46
5-
Controls the mouse from five pushbuttons on an Arduino Leonardo.
7+
Controls the mouse from five pushbuttons on an Arduino Leonardo or Due.
68
79
Hardware:
810
* 5 pushbuttons attached to D2, D3, D4, D5, D6
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/*
22
JoystickMouseControl
33
4-
Controls the mouse from a joystick on an Arduino Leonardo.
4+
For Leonardo and Due boards only.
5+
6+
Controls the mouse from a joystick on an Arduino Leonardo or Due.
57
Uses a pushbutton to turn on and off mouse control, and
68
a second pushbutton to click the left mouse button
79

hardware/arduino/sam/libraries/Audio/examples/SimpleAudioPlayer/SimpleAudioPlayer.ino

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
1+
/*
2+
Simple Audio Player
3+
4+
Demonstrates the use of the Audio library for the Arduino Due
5+
6+
Hardware required :
7+
* Arduino shield with a SD card on CS4
8+
* A sound file named "test.wav" in the root directory of the SD card
9+
* Speaker attched to ground and DAC0
10+
11+
Original by Massimo Banzi September 20, 2012
12+
Modified by Scott Fitzgerald October 19, 2012
13+
14+
This example code is in the public domain
15+
16+
http://arduino.cc/en/Tutorial/SimpleAudioPlayer
17+
18+
*/
19+
120
#include <SD.h>
221
#include <SPI.h>
322
#include <Audio.h>
423

524
void setup()
625
{
7-
// debug output at 115.2K
8-
Serial.begin(115200);
26+
// debug output at 9600 baud
27+
Serial.begin(9600);
928

1029
// setup SD-card
1130
Serial.print("Initializing SD card...");
@@ -27,15 +46,15 @@ void loop()
2746
int count=0;
2847

2948
// open wave file from sdcard
30-
File myFile = SD.open("fadh.wav");
49+
File myFile = SD.open("test.wav");
3150
if (!myFile) {
3251
// if the file didn't open, print an error and stop
33-
Serial.println("error opening fadh.wav");
52+
Serial.println("error opening test.wav");
3453
while (true);
3554
}
3655

3756
const int S=1024; // Number of samples to read in block
38-
int16_t buffer[S];
57+
short buffer[S];
3958

4059
Serial.print("Playing");
4160
// until the file is not finished
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#######################################
2+
# Syntax Coloring Map For Audio
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
Audio KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
15+
prepare KEYWORD2
16+
write KEYWORD2
17+
18+
#######################################
19+
# Constants (LITERAL1)
20+
#######################################
21+

hardware/arduino/sam/libraries/Scheduler/examples/MultipleBlinks/MultipleBlinks.ino

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
Multiple Blinks
3+
4+
Demonstrates the use of the Scheduler library for the Arduino Due
5+
6+
Hardware required :
7+
* LEDs connected to pins 11, 12, and 13
8+
9+
created 8 Oct 2012
10+
by Cristian Maglie
11+
Modified by
12+
Scott Fitzgerald 19 Oct 2012
13+
14+
This example code is in the public domain
15+
16+
http://arduino.cc/en/Tutorial/MultipleBlinks
17+
18+
*/
19+
120

221
// Include Scheduler since we want to manage multiple tasks.
322
#include <Scheduler.h>
@@ -7,7 +26,7 @@ int led2 = 12;
726
int led3 = 11;
827

928
void setup() {
10-
Serial.begin(115200);
29+
Serial.begin(9600);
1130

1231
// Setup the 3 pins as OUTPUT
1332
pinMode(led1, OUTPUT);
@@ -42,7 +61,7 @@ void loop2() {
4261
wait(100);
4362
}
4463

45-
// Task no.3: accept commands from Serial1 port
64+
// Task no.3: accept commands from Serial port
4665
// '0' turns off LED
4766
// '1' turns on LED
4867
void loop3() {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#######################################
2+
# Syntax Coloring Map For Scheduler
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
Scheduler KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
15+
yield KEYWORD2
16+
wait KEYWORD2
17+
startLoop KEYWORD2
18+
19+
#######################################
20+
# Constants (LITERAL1)
21+
#######################################
22+

hardware/arduino/sam/libraries/USBHost/examples/ADKTerminalTest/ADKTerminalTest.ino

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1+
/*
2+
3+
ADK Terminal Test
4+
5+
This demonstrates USB Host connectivity between an
6+
Android phone and an Arduino Due.
7+
8+
The ADK for the Arduino Due is a work in progress
9+
For additional information on the Arduino ADK visit
10+
http://labs.arduino.cc/ADK/Index
11+
12+
created 27 June 2012
13+
by Cristian Maglie
14+
15+
*/
16+
117
#include "variant.h"
218
#include <stdio.h>
319
#include <adk.h>
420

521
// Accessory descriptor. It's how Arduino identifies itself to Android.
622
char applicationName[] = "Arduino_Terminal"; // the app on your phone
7-
char accessoryName[] = "Arduino Due X"; // your Arduino board
23+
char accessoryName[] = "Arduino Due"; // your Arduino board
824
char companyName[] = "Arduino SA";
925

1026
// Make up anything you want for these

0 commit comments

Comments
 (0)