Skip to content

Commit e6f378f

Browse files
authored
Merge pull request #2 from sparkfun/v10
v11 Merge (erroneously named v10 in branch name)
2 parents 7852de0 + 2278ae6 commit e6f378f

File tree

12 files changed

+569
-155
lines changed

12 files changed

+569
-155
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Add new issue to main project
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
jobs:
9+
add-to-project:
10+
name: Add issue to project
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/add-to-project@main
14+
with:
15+
project-url: https://github.com/orgs/sparkfun/projects/19
16+
github-token: ${{ secrets.DEFECT_ADD_TO_PROJECT }}

.github/workflows/compile-sketch.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Cross-compilation
2+
3+
on:
4+
- push
5+
#- pull_request
6+
7+
8+
jobs:
9+
compile-sketch:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
fail-fast: false
14+
15+
matrix:
16+
board:
17+
# Uno
18+
# https://github.com/arduino/ArduinoCore-avr/blob/master/boards.txt
19+
- fqbn: arduino:avr:mega
20+
platforms: |
21+
- name: arduino:avr
22+
source-url: https://downloads.arduino.cc/packages/package_index.json
23+
24+
# ESP32
25+
# https://github.com/espressif/arduino-esp32/blob/master/boards.txt
26+
- fqbn: esp32:esp32:esp32
27+
platforms: |
28+
- name: esp32:esp32
29+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
30+
31+
# ESP32-S2
32+
# https://github.com/espressif/arduino-esp32/blob/master/boards.txt
33+
- fqbn: esp32:esp32:esp32s2
34+
platforms: |
35+
- name: esp32:esp32
36+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
37+
38+
# ESP32-C3
39+
# https://github.com/espressif/arduino-esp32/blob/master/boards.txt
40+
- fqbn: esp32:esp32:esp32c3
41+
platforms: |
42+
- name: esp32:esp32
43+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
44+
45+
# Artemis / Apollo3
46+
# https://github.com/sparkfun/Arduino_Apollo3/blob/main/boards.txt
47+
- fqbn: SparkFun:apollo3:sfe_artemis_atp
48+
platforms: |
49+
- name: SparkFun:apollo3
50+
source-url: https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/master/package_sparkfun_apollo3_index.json
51+
52+
# ESP8266
53+
# https://github.com/esp8266/Arduino/blob/master/boards.txt
54+
- fqbn: esp8266:esp8266:thingdev
55+
platforms: |
56+
- name: esp8266:esp8266
57+
source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
58+
59+
# SAMD21
60+
# https://github.com/arduino/ArduinoCore-samd/blob/master/boards.txt
61+
- fqbn: arduino:samd:mkr1000
62+
platforms: |
63+
- name: arduino:samd
64+
# source-url: https://downloads.arduino.cc/packages/package_index.json
65+
66+
# Nano BLE 33 / nRF52840
67+
# https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt
68+
- fqbn: arduino:mbed:nano33ble
69+
platforms: |
70+
- name: arduino:mbed
71+
# source-url: https://downloads.arduino.cc/packages/package_index.json
72+
73+
# RP2040
74+
# https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt
75+
- fqbn: rp2040:rp2040:sparkfun_promicrorp2040
76+
platforms: |
77+
- name: rp2040:rp2040
78+
source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
79+
80+
# STM32
81+
# https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt
82+
- fqbn: STMicroelectronics:stm32:GenF4
83+
platforms: |
84+
- name: STMicroelectronics:stm32
85+
source-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
86+
87+
steps:
88+
- name: Checkout
89+
uses: actions/checkout@v3
90+
91+
- name: Branch name
92+
run: echo running on branch ${GITHUB_REF##*/}
93+
94+
- name: Compile Sketch
95+
uses: arduino/compile-sketches@v1.1.0
96+
with:
97+
platforms: ${{ matrix.board.platforms }}
98+
fqbn: ${{ matrix.board.fqbn }}
99+
libraries: |
100+
- source-path: ./
101+
- name: SparkFun Toolkit
102+
sketch-paths: |
103+
- examples/Example1_BasicReadings
104+
enable-warnings-report: true
105+
enable-deltas-report: true
106+
verbose: true
107+
108+
# outputs:
109+
# report-artifact-name: ${{ steps.report-artifact-name.outputs.report-artifact-name }}
110+

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
</th>
88
</tr>
99
<tr align="center">
10-
<td><a href="https://www.sparkfun.com/products/17777"><img src="https://cdn.sparkfun.com//assets/parts/1/6/9/1/6/17777-SparkFun_Qwiic_Ultrasonic_Distance_Sensor_-_HC-SR04-01.jpg" alt=""></a></td>
10+
<td><a href="https://www.sparkfun.com/products/24805"><img src="https://cdn.sparkfun.com/assets/parts/2/5/0/9/7/SEN-24805-Ultrasonic-Distance-Sensor-Feature.jpg" alt=""></a></td>
1111
</tr>
1212
<tr align="center">
13-
<td><a href="https://www.sparkfun.com/products/17777">SparkFun Qwiic Ultrasonic Distance Sensor - HC-SR04</a></td>
13+
<td><a href="https://www.sparkfun.com/products/24805">SparkFun Ultrasonic Distance Sensor - TCT40 (Qwiic)</a></td>
1414
</tr>
1515
</table>
1616

17-
You may be familiar with the classic [HC-SR04 distance sensor](https://www.sparkfun.com/products/15569), it is great for providing non-contact distance readings from 2cm to 400cm. The SparkFun Qwiic Ultrasonic Distance Sensor improves on the classic by adding a pair of Qwiic connectors to it, so now you can communicate over I2C and daisy chain any other Qwiic product of your choosing.
17+
The SparkFun Qwiic Ultrasonic Distance Sensor, a user-friendly upgrade to the popular HC-SR04 sensor, offers non-contact distance measurement from 2cm to 400cm with an accuracy of 3mm. This sensor is designed to seamlessly integrate with the Qwiic ecosystem for I<sup>2</sup>C communication, making it a breeze to add to your existing projects and daisy-chain with other Qwiic components.
1818

19-
If you prefer to bypass the Qwiic connector and I2C you can also access the VCC, Trigger, Echo, and Ground pins broken out on the edge of the board. Please be aware that this ultrasonic sensor comes uncalibrated and you will need manipulate the raw output for your specific application.
19+
With its wide range of applications, the SparkFun Qwiic Ultrasonic Distance Sensor is a versatile tool for robotics projects, obstacle avoidance systems, and any application that requires accurate distance measurement without physical contact. Its adaptability makes it a valuable addition to your toolkit.
2020

2121
Repository Contents
2222
-------------------
@@ -27,8 +27,8 @@ Repository Contents
2727

2828
Documentation
2929
--------------
30-
* **[GitHub Repo](https://github.com/sparkfun/Zio-Qwiic-Ultrasonic-Distance-Sensor)** - GitHub repo for the SparkFun Qwiic Ultrasonic Distance Sensor - HC-SR04 Hardware Files.
31-
* **[Hookup Guide](https://learn.sparkfun.com/tutorials/qwiic-ultrasonic-distance-sensor-hc-sr04-hookup-guide)** - Basic hookup guide for the SparkFun Qwiic Ultrasonic Distance Sensor - HC-SR04.
30+
* **[GitHub Repo](https://github.com/sparkfun/SparkFun_Ultrasonic_Distance_Sensor-Qwiic/tree/v11_Firmware_v01)** - GitHub repo for the SparkFun Ultrasonic Distance Sensor - TCT40 (Qwiic) Hardware Files.
31+
* **[Hookup Guide](https://docs.sparkfun.com/SparkFun_Ultrasonic_Distance_Sensor-Qwiic/)** - Basic hookup guide for the SparkFun Ultrasonic Distance Sensor - TCT40 (Qwiic).
3232

3333
License Information
3434
-------------------
Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* SparkFun Ulrasonic Distance Sensor - Example 1 Basic Distance Sensing
2+
*
3+
* Product:
4+
* * SparkFun Qwiic Ultrasonic Distance Sensor - HC-SR04 (SEN-1XXXX)
5+
* * https://www.sparkfun.com/1XXXX
6+
*
7+
* Written By: Elias Santistevan
8+
* Date: 06/2024
9+
*
10+
* SPDX-License-Identifier: MIT
11+
*
12+
* Copyright (c) 2024 SparkFun Electronics
13+
*/
14+
115
#include "SparkFun_Qwiic_Ultrasonic_Arduino_Library.h"
216

317
// Create an ultrasonic sensor object
@@ -12,33 +26,37 @@ uint8_t deviceAddress = kQwiicUltrasonicDefaultAddress; // 0x2F
1226

1327
void setup()
1428
{
15-
// Start serial
16-
Serial.begin(115200);
17-
Serial.println("Qwiic Ultrasonic Example 1 - Basic Readings");
29+
// Start serial
30+
Serial.begin(115200);
31+
Serial.println("Ultrasonic Distance Sensor Example 1 - Basic Readings");
1832

19-
Wire.begin();
33+
Wire.begin();
2034

21-
// Attempt to begin the sensor
22-
while (myUltrasonic.begin(deviceAddress) == false)
23-
{
24-
Serial.println("Ultrasonic sensor not connected, check your wiring and I2C address!");
25-
delay(1000);
26-
}
35+
// Attempt to begin the sensor
36+
while (myUltrasonic.begin(deviceAddress) == false)
37+
{
38+
Serial.println("Ultrasonic sensor not connected, check your wiring and I2C address!");
39+
delay(2000);
40+
}
2741

28-
Serial.println("Ultrasonic sensor connected!");
42+
Serial.println("Ultrasonic sensor connected!");
2943
}
3044

3145
void loop()
3246
{
33-
// Get measurement from sensor. Note that the mesaured distance actually
34-
// comes from the previous trigger, so measurements will be slightly delayed
35-
uint16_t distance = 0;
36-
myUltrasonic.triggerAndRead(distance);
37-
38-
// Print measurement
39-
Serial.print("Distance (mm): ");
40-
Serial.println(distance);
41-
42-
// Wait a bit
43-
delay(100);
44-
}
47+
uint16_t distance = 0;
48+
myUltrasonic.triggerAndRead(distance);
49+
50+
// Print measurement
51+
Serial.print("Distance (mm): ");
52+
Serial.println(distance);
53+
54+
//Serial.println("Distance (cm): ");
55+
//Serial.print((distance / 10.0), 2);
56+
57+
//Serial.println("Distace (in): ");
58+
//Serial.print((distance / 25.4), 2);
59+
60+
// Wait a bit
61+
delay(250);
62+
}

examples/Example2_ChangeAddress/Example2_ChangeAddress.ino

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

0 commit comments

Comments
 (0)