Skip to content

Commit b5cbe76

Browse files
authored
Merge pull request arduino#84 from bcmi-labs/analogWave_sample
analogWave: add basic example Former-commit-id: 7979e8c
2 parents e1c6f7b + cac42dd commit b5cbe76

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

.github/workflows/compile-examples.yml

+14-10
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
# sketch paths to compile (recursive) for all boards
2727
UNIVERSAL_SKETCH_PATHS: |
2828
- libraries/AnalogWave
29-
- libraries/Arduino_CAN/CANRead
30-
- libraries/Arduino_CAN/CANWrite
29+
- libraries/Arduino_CAN/examples/CANRead
30+
- libraries/Arduino_CAN/examples/CANWrite
3131
- libraries/Arduino_FreeRTOS
3232
- libraries/EEPROM
3333
- libraries/RTC
@@ -38,15 +38,15 @@ jobs:
3838

3939
matrix:
4040
board: [
41-
{"fqbn": "arduino:renesas:portenta_c33"},
42-
{"fqbn": "arduino:renesas:minima"},
43-
{"fqbn": "arduino:renesas:unor4wifi"},
41+
{"fqbn": "arduino-git:renesas:portenta_c33"},
42+
{"fqbn": "arduino-git:renesas:minima"},
43+
{"fqbn": "arduino-git:renesas:unor4wifi"},
4444
]
4545

4646
# make board type-specific customizations to the matrix jobs
4747
include:
4848
- board:
49-
fqbn: "arduino:renesas:portenta_c33"
49+
fqbn: "arduino-git:renesas:portenta_c33"
5050
additional-sketch-paths: |
5151
- libraries/WiFi
5252
- libraries/UsbMsd
@@ -55,17 +55,21 @@ jobs:
5555
- libraries/SSLClient
5656
- libraries/SE05X
5757
- libraries/Ethernet
58-
- libraries/Arduino_CAN/CAN1Read
59-
- libraries/Arduino_CAN/CAN1Write
58+
- libraries/Arduino_CAN/examples/CAN1Read
59+
- libraries/Arduino_CAN/examples/CAN1Write
6060
- board:
61-
fqbn: "arduino:renesas:unor4wifi"
61+
fqbn: "arduino-git:renesas:unor4wifi"
6262
additional-sketch-paths: |
6363
- libraries/WiFiS3
6464
- libraries/Arduino_LED_Matrix
6565
6666
steps:
6767
- name: Checkout repository
6868
uses: actions/checkout@v2
69+
with:
70+
submodules: recursive
71+
token: ${{ secrets.PRIVATE_SUBMODULES_CLONE }}
72+
fetch-depth: 0
6973

7074
# The source files are in a subfolder of the ArduinoCore-API repository, so it's not possible to clone it directly to the final destination in the core
7175
- name: Checkout ArduinoCore-API
@@ -120,7 +124,7 @@ jobs:
120124
source-url: "https://downloads.arduino.cc/packages/package_renesas_secret_index.json"
121125
# Overwrite the Board Manager installation with the local platform
122126
- source-path: "./"
123-
name: "arduino:renesas"
127+
name: "arduino-git:renesas"
124128
sketch-paths: |
125129
${{ env.UNIVERSAL_SKETCH_PATHS }}
126130
${{ matrix.additional-sketch-paths }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "analogWave.h"
2+
3+
analogWave wave(DAC);
4+
5+
int freq = 10; // in hertz, change accordingly
6+
7+
void setup() {
8+
Serial.begin(115200);
9+
pinMode(A0, INPUT);
10+
wave.sine(freq);
11+
}
12+
13+
void loop() {
14+
freq = map(analogRead(A0), 0, 1024, 0, 10000);
15+
Serial.println("Frequency is now " + String(freq) + " hz");
16+
wave.freq(freq);
17+
delay(1000);
18+
}

0 commit comments

Comments
 (0)