Skip to content

Commit ac40684

Browse files
Pushed initial library, variant, and board.txt changes. Files work locally but are not attached to the manager correctly
1 parent 8eeed95 commit ac40684

File tree

10 files changed

+1170
-0
lines changed

10 files changed

+1170
-0
lines changed

sparkfun/avr/boards.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,40 @@ atmega128rfa1.build.f_cpu=16000000L
345345
atmega128rfa1.build.board=ATMEGA128RFA1_DEV_BOARD
346346
atmega128rfa1.build.core=arduino:arduino
347347
atmega128rfa1.build.variant=rf128
348+
349+
################################################################################
350+
###################### LilyPad Prototyping Board ###############################
351+
################################################################################
352+
353+
LilyPadProtoUSB.name=LilyPad Prototyping Board
354+
LilyPadProtoUSB.vid.0=0x1B4F
355+
LilyPadProtoUSB.pid.0=0x9207
356+
LilyPadProtoUSB.vid.1=0x1B4F
357+
LilyPadProtoUSB.pid.1=0x9208
358+
359+
LilyPadProtoUSB.upload.tool=avrdude
360+
LilyPadProtoUSB.upload.protocol=avr109
361+
LilyPadProtoUSB.upload.maximum_size=28672
362+
LilyPadProtoUSB.upload.maximum_data_size=2560
363+
LilyPadProtoUSB.upload.speed=57600
364+
LilyPadProtoUSB.upload.disable_flushing=true
365+
LilyPadProtoUSB.upload.use_1200bps_touch=true
366+
LilyPadProtoUSB.upload.wait_for_upload_port=true
367+
368+
LilyPadProtoUSB.bootloader.tool=avrdude
369+
LilyPadProtoUSB.bootloader.low_fuses=0xff
370+
LilyPadProtoUSB.bootloader.high_fuses=0xd8
371+
LilyPadProtoUSB.bootloader.extended_fuses=0xce
372+
LilyPadProtoUSB.bootloader.file=caterina-LilyPadUSB/Caterina-LilyPadUSB.hex
373+
LilyPadProtoUSB.bootloader.unlock_bits=0x3F
374+
LilyPadProtoUSB.bootloader.lock_bits=0x2F
375+
376+
LilyPadProtoUSB.build.mcu=atmega32u4
377+
LilyPadProtoUSB.build.f_cpu=8000000L
378+
LilyPadProtoUSB.build.vid=0x1B4F
379+
LilyPadProtoUSB.build.pid=0x9208
380+
LilyPadProtoUSB.build.usb_product="LilyPad USB"
381+
LilyPadProtoUSB.build.board=AVR_LILYPAD_USB
382+
LilyPadProtoUSB.build.core=arduino
383+
LilyPadProtoUSB.build.variant=lilypadprototypingboard
384+
LilyPadProtoUSB.build.extra_flags={build.usb_flags}

sparkfun/avr/libraries/LilyPadPrototypingBoard/LilyPadPrototypingBoard.cpp

Whitespace-only changes.

sparkfun/avr/libraries/LilyPadPrototypingBoard/LilyPadPrototypingBoard.h

Whitespace-only changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#define BTNPIN 4
2+
3+
#define SWPIN 9
4+
5+
void setup() {
6+
pinMode( BTNPIN, INPUT_PULLUP);
7+
pinMode( SWPIN, INPUT_PULLUP);
8+
Serial.begin(9600);
9+
}
10+
11+
void loop() {
12+
Serial.print(digitalRead(BTNPIN));
13+
Serial.print(", ");
14+
Serial.print(digitalRead(SWPIN));
15+
Serial.println();
16+
17+
delay(200);
18+
}
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
/*
2+
Melody
3+
4+
Plays a melody
5+
6+
circuit:
7+
* 8-ohm speaker on digital pin 8
8+
9+
created 21 Jan 2010
10+
modified 30 Aug 2011
11+
by Tom Igoe
12+
13+
This example code is in the public domain.
14+
15+
http://www.arduino.cc/en/Tutorial/Tone
16+
17+
*/
18+
/*************************************************
19+
* Public Constants
20+
*************************************************/
21+
22+
#define NOTE_B0 31
23+
#define NOTE_C1 33
24+
#define NOTE_CS1 35
25+
#define NOTE_D1 37
26+
#define NOTE_DS1 39
27+
#define NOTE_E1 41
28+
#define NOTE_F1 44
29+
#define NOTE_FS1 46
30+
#define NOTE_G1 49
31+
#define NOTE_GS1 52
32+
#define NOTE_A1 55
33+
#define NOTE_AS1 58
34+
#define NOTE_B1 62
35+
#define NOTE_C2 65
36+
#define NOTE_CS2 69
37+
#define NOTE_D2 73
38+
#define NOTE_DS2 78
39+
#define NOTE_E2 82
40+
#define NOTE_F2 87
41+
#define NOTE_FS2 93
42+
#define NOTE_G2 98
43+
#define NOTE_GS2 104
44+
#define NOTE_A2 110
45+
#define NOTE_AS2 117
46+
#define NOTE_B2 123
47+
#define NOTE_C3 131
48+
#define NOTE_CS3 139
49+
#define NOTE_D3 147
50+
#define NOTE_DS3 156
51+
#define NOTE_E3 165
52+
#define NOTE_F3 175
53+
#define NOTE_FS3 185
54+
#define NOTE_G3 196
55+
#define NOTE_GS3 208
56+
#define NOTE_A3 220
57+
#define NOTE_AS3 233
58+
#define NOTE_B3 247
59+
#define NOTE_C4 262
60+
#define NOTE_CS4 277
61+
#define NOTE_D4 294
62+
#define NOTE_DS4 311
63+
#define NOTE_E4 330
64+
#define NOTE_F4 349
65+
#define NOTE_FS4 370
66+
#define NOTE_G4 392
67+
#define NOTE_GS4 415
68+
#define NOTE_A4 440
69+
#define NOTE_AS4 466
70+
#define NOTE_B4 494
71+
#define NOTE_C5 523
72+
#define NOTE_CS5 554
73+
#define NOTE_D5 587
74+
#define NOTE_DS5 622
75+
#define NOTE_E5 659
76+
#define NOTE_F5 698
77+
#define NOTE_FS5 740
78+
#define NOTE_G5 784
79+
#define NOTE_GS5 831
80+
#define NOTE_A5 880
81+
#define NOTE_AS5 932
82+
#define NOTE_B5 988
83+
#define NOTE_C6 1047
84+
#define NOTE_CS6 1109
85+
#define NOTE_D6 1175
86+
#define NOTE_DS6 1245
87+
#define NOTE_E6 1319
88+
#define NOTE_F6 1397
89+
#define NOTE_FS6 1480
90+
#define NOTE_G6 1568
91+
#define NOTE_GS6 1661
92+
#define NOTE_A6 1760
93+
#define NOTE_AS6 1865
94+
#define NOTE_B6 1976
95+
#define NOTE_C7 2093
96+
#define NOTE_CS7 2217
97+
#define NOTE_D7 2349
98+
#define NOTE_DS7 2489
99+
#define NOTE_E7 2637
100+
#define NOTE_F7 2794
101+
#define NOTE_FS7 2960
102+
#define NOTE_G7 3136
103+
#define NOTE_GS7 3322
104+
#define NOTE_A7 3520
105+
#define NOTE_AS7 3729
106+
#define NOTE_B7 3951
107+
#define NOTE_C8 4186
108+
#define NOTE_CS8 4435
109+
#define NOTE_D8 4699
110+
#define NOTE_DS8 4978
111+
112+
113+
114+
115+
// notes in the melody:
116+
int melody[] = {
117+
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
118+
};
119+
120+
// note durations: 4 = quarter note, 8 = eighth note, etc.:
121+
int noteDurations[] = {
122+
4, 8, 8, 4, 4, 4, 4, 4
123+
};
124+
125+
void setup() {
126+
}
127+
128+
void loop() {
129+
// no need to repeat the melody.
130+
// iterate over the notes of the melody:
131+
for (int thisNote = 0; thisNote < 8; thisNote++) {
132+
133+
// to calculate the note duration, take one second
134+
// divided by the note type.
135+
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
136+
int noteDuration = 1000 / noteDurations[thisNote];
137+
tone(3, melody[thisNote], noteDuration);
138+
139+
// to distinguish the notes, set a minimum time between them.
140+
// the note's duration + 30% seems to work well:
141+
int pauseBetweenNotes = noteDuration * 1.30;
142+
delay(pauseBetweenNotes);
143+
// stop the tone playing:
144+
noTone(3);
145+
}
146+
// for (int thisNote = 0; thisNote < 8; thisNote++) {
147+
//
148+
// // to calculate the note duration, take one second
149+
// // divided by the note type.
150+
// //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
151+
// int noteDuration = 1000 / noteDurations[thisNote];
152+
// tone(9, melody[thisNote], noteDuration);
153+
//
154+
// // to distinguish the notes, set a minimum time between them.
155+
// // the note's duration + 30% seems to work well:
156+
// int pauseBetweenNotes = noteDuration * 1.30;
157+
// delay(pauseBetweenNotes);
158+
// // stop the tone playing:
159+
// noTone(9);
160+
// }
161+
}

0 commit comments

Comments
 (0)