Skip to content

Commit db5bbad

Browse files
committed
Merge remote-tracking branch 'adafruit/master'
2 parents 5af8a00 + e48993f commit db5bbad

121 files changed

Lines changed: 460046 additions & 129074 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#define TC_PIN A0 // set to ADC pin used
2+
#define AREF 3.3 // set to AREF, typically board voltage like 3.3 or 5.0
3+
#define ADC_RESOLUTION 10 // set to ADC bit resolution, 10 is default
4+
5+
float reading, voltage, temperature;
6+
7+
float get_voltage(int raw_adc) {
8+
return raw_adc * (AREF / (pow(2, ADC_RESOLUTION)-1));
9+
}
10+
11+
float get_temperature(float voltage) {
12+
return (voltage - 1.25) / 0.005;
13+
}
14+
15+
void setup() {
16+
Serial.begin(9600);
17+
}
18+
19+
void loop() {
20+
reading = analogRead(TC_PIN);
21+
voltage = get_voltage(reading);
22+
temperature = get_temperature(voltage);
23+
Serial.print("Temperature = ");
24+
Serial.print(temperature);
25+
Serial.println(" C");
26+
delay(500);
27+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import time
2+
import analogio
3+
import board
4+
5+
ad8495 = analogio.AnalogIn(board.A1)
6+
7+
8+
def get_voltage(pin):
9+
return (pin.value * 3.3) / 65536
10+
11+
12+
while True:
13+
temperature = (get_voltage(ad8495) - 1.25) / 0.005
14+
print(temperature)
15+
print(get_voltage(ad8495))
16+
time.sleep(0.5)
Binary file not shown.

Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/SerialESPPassthrough.ino

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,46 @@
1919
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
*/
2121

22+
#include <Adafruit_NeoPixel.h>
23+
2224
unsigned long baud = 115200;
2325

26+
Adafruit_NeoPixel pixel = Adafruit_NeoPixel(1, 2, NEO_GRB + NEO_KHZ800);
27+
28+
2429
void setup() {
2530
Serial.begin(baud);
31+
pixel.begin();
32+
pixel.setPixelColor(0, 10, 10, 10); pixel.show();
33+
34+
while (!Serial);
35+
pixel.setPixelColor(0, 50, 50, 50); pixel.show();
2636

37+
delay(100);
2738
SerialNina.begin(baud);
2839

2940
pinMode(13, OUTPUT);
30-
pinMode(ESP32_GPIO0, OUTPUT);
31-
pinMode(ESP32_RESETN, OUTPUT);
41+
pinMode(NINA_GPIO0, OUTPUT);
42+
pinMode(NINA_RESETN, OUTPUT);
3243

3344
// manually put the ESP32 in upload mode
34-
digitalWrite(ESP32_GPIO0, LOW);
45+
digitalWrite(NINA_GPIO0, LOW);
3546

36-
digitalWrite(ESP32_RESETN, LOW);
47+
digitalWrite(NINA_RESETN, LOW);
48+
delay(100);
49+
digitalWrite(NINA_RESETN, HIGH);
50+
pixel.setPixelColor(0, 20, 20, 0); pixel.show();
3751
delay(100);
38-
digitalWrite(ESP32_RESETN, HIGH);
39-
4052
}
4153

4254
void loop() {
43-
if (Serial.available()) {
44-
digitalWrite(13, HIGH);
55+
while (Serial.available()) {
56+
pixel.setPixelColor(0, 10, 0, 0); pixel.show();
4557
SerialESP32.write(Serial.read());
46-
digitalWrite(13, LOW);
4758
}
4859

49-
if (SerialESP32.available()) {
50-
Serial.write(SerialESP32.read());
60+
while (SerialNina.available()) {
61+
pixel.setPixelColor(0, 0, 0, 10); pixel.show();
62+
Serial.write(SerialNina.read());
5163
}
5264
}

Adafruit_MTK3329_GPS/.uno.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/ Test code for Adafruit GPS modules using MTK driver
2+
// such as www.adafruit.com/products/660 (discontinued)
3+
// For new use see www.adafruit.com/products/746 (needs different code)
4+
// help support open source hardware & software! -adafruit
5+
6+
#include <SoftSerial.h>
7+
SoftSerial mySerial(2, 3);
8+
9+
// Connect the GPS Power pin to 3.3V
10+
// Connect the GPS Ground pin to ground
11+
// Connect the GPS VBAT pin to 3.3V if no battery is used
12+
// Connect the GPS TX (transmit) pin to Digital 2
13+
// Connect the GPS RX (receive) pin to Digital 3
14+
// For 3.3V only modules such as the UP501, connect a 10K
15+
// resistor between digital 3 and GPS RX and a 10K resistor
16+
// from GPS RX to ground.
17+
18+
// different commands to set the update rate from once a second (1 Hz) to 10 times a second (10Hz)
19+
#define PMTK_SET_NMEA_UPDATE_1HZ "$PMTK220,1000*1F"
20+
#define PMTK_SET_NMEA_UPDATE_5HZ "$PMTK220,200*2C"
21+
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F"
22+
23+
// turn on only the second sentence (GPRMC)
24+
#define PMTK_SET_NMEA_OUTPUT_RMCONLY "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29"
25+
// turn on ALL THE DATA
26+
#define PMTK_SET_NMEA_OUTPUT_ALLDATA "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28"
27+
28+
// to generate your own sentences, check out the MTK command datasheet and use a checksum calculator
29+
// such as the awesome http://www.hhhh.org/wiml/proj/nmeaxor.html
30+
31+
void setup()
32+
{
33+
Serial.begin(57600);
34+
Serial.println("Adafruit MTK3329 NMEA test!");
35+
36+
// 9600 NMEA is the default baud rate
37+
mySerial.begin(9600);
38+
39+
// uncomment this line to turn on only the "minimum recommended" data for high update rates!
40+
//mySerial.println(PMTK_SET_NMEA_OUTPUT_RMCONLY);
41+
42+
// uncomment this line to turn on all the available data - for 9600 baud you'll want 1 Hz rate
43+
mySerial.println(PMTK_SET_NMEA_OUTPUT_ALLDATA);
44+
45+
// Set the update rate
46+
// 1 Hz update rate
47+
mySerial.println(PMTK_SET_NMEA_UPDATE_1HZ);
48+
// 5 Hz update rate- for 9600 baud you'll have to set the output to RMC only (see above)
49+
//mySerial.println(PMTK_SET_NMEA_UPDATE_5HZ);
50+
// 10 Hz update rate - for 9600 baud you'll have to set the output to RMC only (see above)
51+
//mySerial.println(PMTK_SET_NMEA_UPDATE_10HZ);
52+
53+
}
54+
55+
void loop() // run over and over again
56+
{
57+
58+
if (mySerial.available()) {
59+
Serial.print((char)mySerial.read());
60+
}
61+
if (Serial.available()) {
62+
mySerial.print((char)Serial.read());
63+
}
64+
}

Adafruit_MTK3329_GPS/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Adafruit MTK3329 GPS Module Test Code
2+
3+
Test File for the discontinued Adafruit MTK3329 GPS Module Product UP501 Breadboard-friendly 66 channel GPS module w/10 Hz updates, Adafruit Product ID: 660
4+
5+
If you are making a new project, we highly suggest the [Adafruit Ultimate GPS Module](https://www.adafruit.com/product/746) Product ID: 746
6+
which is still available, supported, and has examples on the [Adafruit Learning System](https://learn.adafruit.com).
7+
8+
9+
The code was formerly at https://github.com/adafruit/Adafruit-MTK3329-GPS-Module-Test-Sketch/ - this has now been archived.
10+
11+
If you are looking to make changes/additions, please use the GitHub Issues and Pull Request mechanisms.
12+
13+
All code MIT License, please attribute to Adafruit Industries, Limor Fried
14+
15+
Please consider buying your parts at [Adafruit.com](https://www.adafruit.com) to support open source code

Arduino_Ethernet_SD_Card/.uno.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Arduino_Ethernet_SD_Card/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Arduino Ethernet and SD Card Sketches
22

3-
Code to accompany this Adafruit tutorial:
4-
https://learn.adafruit.com/arduino-ethernet-sd-card
3+
Code to accompany the Adafruit tutorial: https://learn.adafruit.com/arduino-ethernet-sd-card
4+
5+
See the tutorial for details.
6+
7+
All code MIT License, please keep attribution
8+
9+
Please consider buying your parts at [Adafruit.com](https://www.adafruit.com) to support open source code.

0 commit comments

Comments
 (0)