Skip to content

Commit d606e27

Browse files
committed
2 parents 3ffca40 + 703200b commit d606e27

File tree

7 files changed

+136
-40
lines changed

7 files changed

+136
-40
lines changed

IDE_Board_Manager/package_sparkfun_index.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,56 @@
13611361
{ "name": "Sparkfun SAMD51 Thing Plus" },
13621362
{ "name": "Sparkfun Qwiic Micro" }
13631363
],
1364+
"toolsDependencies": [
1365+
{
1366+
"packager": "arduino",
1367+
"name": "arm-none-eabi-gcc",
1368+
"version": "4.8.3-2014q1"
1369+
},
1370+
{
1371+
"packager": "arduino",
1372+
"name": "bossac",
1373+
"version": "1.8.0-48-gb176eee"
1374+
},
1375+
{
1376+
"packager": "arduino",
1377+
"name": "openocd",
1378+
"version": "0.9.0-arduino"
1379+
},
1380+
{
1381+
"packager": "arduino",
1382+
"name": "CMSIS",
1383+
"version": "4.5.0"
1384+
},
1385+
{
1386+
"packager": "arduino",
1387+
"name": "CMSIS-Atmel",
1388+
"version": "1.2.0"
1389+
}
1390+
]
1391+
},
1392+
{
1393+
"name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)",
1394+
"architecture": "samd",
1395+
"version": "1.7.2",
1396+
"category": "Contributed",
1397+
"url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.7.2.tar.bz2",
1398+
"archiveFileName": "sparkfun-samd-1.7.2.tar.bz2",
1399+
"checksum": "SHA-256:8356F897430129912057E7D7AB8611D2739B8B79E7E0E47CD0A798255D19E960",
1400+
"size": "1713505",
1401+
"help": {
1402+
"online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager"
1403+
},
1404+
"boards": [
1405+
{ "name": "SparkFun SAMD21 Mini Breakout" },
1406+
{ "name": "SparkFun SAMD21 Dev Breakout" },
1407+
{ "name": "SparkFun 9DoF Razor IMU M0" },
1408+
{ "name": "LilyPad LilyMini" },
1409+
{ "name": "Sparkfun SAMD21 Pro RF" },
1410+
{ "name": "Sparkfun RedBoard Turbo" },
1411+
{ "name": "Sparkfun SAMD51 Thing Plus" },
1412+
{ "name": "Sparkfun Qwiic Micro" }
1413+
],
13641414
"toolsDependencies": [
13651415
{
13661416
"packager": "arduino",
1.63 MB
Binary file not shown.

sparkfun/avr/Qduino/Qduino.cpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* mattnewberry@me.com *
88
* *
99
***************************************************************************
10-
* *
10+
* *
1111
* This program is free software; you can redistribute it and/or modify *
1212
* it under the terms of the GNU License. *
1313
* This program is distributed in the hope that it will be useful, *
@@ -22,7 +22,7 @@
2222
#include "Wire.h"
2323

2424
void qduino::setup(){
25-
25+
2626
pinMode(13, OUTPUT);
2727
digitalWrite(13, HIGH);
2828
pinMode(11, OUTPUT);
@@ -32,21 +32,21 @@ void qduino::setup(){
3232
}
3333

3434
void qduino::setRGB(uint8_t r, uint8_t g, uint8_t b){
35-
35+
3636
// ratio for R:G:B is 4:7:7 for forward voltage
37-
37+
3838
r = 255 - r; // set all values to opposite values
3939
g = 255 - g; // because LED is common anode
4040
b = 255 - b;
41-
41+
4242
int newr = map(r, 0, 255, 0, 146);
43-
43+
4444
analogWrite(10, newr);
4545
analogWrite(11, g);
4646
analogWrite(13, b);
4747
}
4848

49-
void qduino::setRGB(COLORS color){
49+
void qduino::setRGB(COLORS color){
5050
switch (color) {
5151
case RED:
5252
analogWrite(10, 0);
@@ -97,31 +97,31 @@ void qduino::setRGB(COLORS color){
9797
}
9898

9999
void qduino::rainbow(uint8_t duration)
100-
{
100+
{
101101
uint8_t rgbColor[3];
102102

103103
// Keep values for duration bounded
104104
if (duration < 1) duration = 1;
105105
if (duration > 5) duration = 5;
106-
106+
107107
int newDuration = map(duration, 1, 5, 500, 3000);
108-
108+
109109
// Start off with red.
110110
rgbColor[0] = 255;
111111
rgbColor[1] = 0;
112-
rgbColor[2] = 0;
113-
112+
rgbColor[2] = 0;
113+
114114
// Choose the colours to increment and decrement.
115115
for (uint8_t decColor = 0; decColor < 3; decColor += 1)
116116
{
117117
int incColor = decColor == 2 ? 0 : decColor + 1;
118-
118+
119119
// cross-fade the two colours.
120120
for(uint8_t i = 0; i < 255; i += 1)
121121
{
122122
rgbColor[decColor] -= 1;
123123
rgbColor[incColor] += 1;
124-
124+
125125
analogWrite(10, rgbColor[0]);
126126
analogWrite(11, rgbColor[1]);
127127
analogWrite(13, rgbColor[2]);
@@ -131,7 +131,7 @@ void qduino::rainbow(uint8_t duration)
131131
}
132132

133133
void qduino::ledOff()
134-
{
134+
{
135135
analogWrite(10, 255);
136136
analogWrite(11, 255);
137137
analogWrite(13, 255);
@@ -167,7 +167,7 @@ char fuelGauge::getVersion()
167167
byte msb = 0;
168168
byte lsb = 0;
169169
readFrom(MAX1704_VERSION, msb, lsb);
170-
170+
171171
value = 0xFF00 & (msb<<8);
172172
value |= 0xFF & lsb;
173173

@@ -211,7 +211,7 @@ boolean fuelGauge::inSleep()
211211
byte lsb = 0;
212212

213213
readFrom(MAX1704_CONFIG,msb,lsb);
214-
byte sleep = (lsb >>7) & 0x01;
214+
byte sleep = (lsb >>7) & 0x01;
215215

216216
return int(sleep) == 1;
217217
}
@@ -256,7 +256,7 @@ void fuelGauge::wakeUp()
256256
Wire.endTransmission();
257257

258258
// This delay is here to ensure it's fully awake before moving on
259-
delay(150);
259+
delay(150);
260260
}
261261

262262
void fuelGauge::performCommand(byte address, int value)
@@ -281,6 +281,5 @@ void fuelGauge::readFrom(byte address, byte &msb, byte &lsb)
281281
msb = Wire.read();
282282
lsb = Wire.read();
283283
}
284-
Wire.endTransmission();
284+
//Wire.endTransmission();
285285
}
286-

sparkfun/avr/libraries/Qduino/Qduino.cpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* mattnewberry@me.com *
88
* *
99
***************************************************************************
10-
* *
10+
* *
1111
* This program is free software; you can redistribute it and/or modify *
1212
* it under the terms of the GNU License. *
1313
* This program is distributed in the hope that it will be useful, *
@@ -22,7 +22,7 @@
2222
#include "Wire.h"
2323

2424
void qduino::setup(){
25-
25+
2626
pinMode(13, OUTPUT);
2727
digitalWrite(13, HIGH);
2828
pinMode(11, OUTPUT);
@@ -32,21 +32,21 @@ void qduino::setup(){
3232
}
3333

3434
void qduino::setRGB(uint8_t r, uint8_t g, uint8_t b){
35-
35+
3636
// ratio for R:G:B is 4:7:7 for forward voltage
37-
37+
3838
r = 255 - r; // set all values to opposite values
3939
g = 255 - g; // because LED is common anode
4040
b = 255 - b;
41-
41+
4242
int newr = map(r, 0, 255, 0, 146);
43-
43+
4444
analogWrite(10, newr);
4545
analogWrite(11, g);
4646
analogWrite(13, b);
4747
}
4848

49-
void qduino::setRGB(COLORS color){
49+
void qduino::setRGB(COLORS color){
5050
switch (color) {
5151
case RED:
5252
analogWrite(10, 0);
@@ -97,31 +97,31 @@ void qduino::setRGB(COLORS color){
9797
}
9898

9999
void qduino::rainbow(uint8_t duration)
100-
{
100+
{
101101
uint8_t rgbColor[3];
102102

103103
// Keep values for duration bounded
104104
if (duration < 1) duration = 1;
105105
if (duration > 5) duration = 5;
106-
106+
107107
int newDuration = map(duration, 1, 5, 500, 3000);
108-
108+
109109
// Start off with red.
110110
rgbColor[0] = 255;
111111
rgbColor[1] = 0;
112-
rgbColor[2] = 0;
113-
112+
rgbColor[2] = 0;
113+
114114
// Choose the colours to increment and decrement.
115115
for (uint8_t decColor = 0; decColor < 3; decColor += 1)
116116
{
117117
int incColor = decColor == 2 ? 0 : decColor + 1;
118-
118+
119119
// cross-fade the two colours.
120120
for(uint8_t i = 0; i < 255; i += 1)
121121
{
122122
rgbColor[decColor] -= 1;
123123
rgbColor[incColor] += 1;
124-
124+
125125
analogWrite(10, rgbColor[0]);
126126
analogWrite(11, rgbColor[1]);
127127
analogWrite(13, rgbColor[2]);
@@ -131,7 +131,7 @@ void qduino::rainbow(uint8_t duration)
131131
}
132132

133133
void qduino::ledOff()
134-
{
134+
{
135135
analogWrite(10, 255);
136136
analogWrite(11, 255);
137137
analogWrite(13, 255);
@@ -167,7 +167,7 @@ char fuelGauge::getVersion()
167167
byte msb = 0;
168168
byte lsb = 0;
169169
readFrom(MAX1704_VERSION, msb, lsb);
170-
170+
171171
value = 0xFF00 & (msb<<8);
172172
value |= 0xFF & lsb;
173173

@@ -211,7 +211,7 @@ boolean fuelGauge::inSleep()
211211
byte lsb = 0;
212212

213213
readFrom(MAX1704_CONFIG,msb,lsb);
214-
byte sleep = (lsb >>7) & 0x01;
214+
byte sleep = (lsb >>7) & 0x01;
215215

216216
return int(sleep) == 1;
217217
}
@@ -256,7 +256,7 @@ void fuelGauge::wakeUp()
256256
Wire.endTransmission();
257257

258258
// This delay is here to ensure it's fully awake before moving on
259-
delay(150);
259+
delay(150);
260260
}
261261

262262
void fuelGauge::performCommand(byte address, int value)
@@ -281,6 +281,5 @@ void fuelGauge::readFrom(byte address, byte &msb, byte &lsb)
281281
msb = Wire.read();
282282
lsb = Wire.read();
283283
}
284-
Wire.endTransmission();
284+
//Wire.endTransmission();
285285
}
286-

sparkfun/samd/cores/arduino/wiring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ void init( void )
8080
// Clock ADC/DAC for Analog
8181
PM->APBCMASK.reg |= PM_APBCMASK_ADC | PM_APBCMASK_DAC ;
8282

83+
/*
8384
// Setup all pins (digital and analog) in INPUT mode (default is nothing)
8485
for (uint32_t ul = 0 ; ul < NUM_DIGITAL_PINS ; ul++ )
8586
{
8687
pinMode( ul, INPUT ) ;
8788
}
89+
*/
8890

8991
// Initialize Analog Controller
9092
// Setting clock

0 commit comments

Comments
 (0)