-
-
Notifications
You must be signed in to change notification settings - Fork 88
Add comments #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
facchinm
merged 3 commits into
arduino:main
from
Hannes7eicher:Hannes7eicher/R4-exampel-docs
Aug 30, 2023
Merged
Add comments #101
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
#include "analogWave.h" | ||
/* | ||
SineWave | ||
|
||
analogWave wave(DAC); | ||
Generates a pre-generated sawtooth-waveform. | ||
|
||
See the full documentatio here: | ||
https://docs.arduino.cc/tutorials/uno-r4-wifi/dac | ||
*/ | ||
|
||
#include "analogWave.h" // Include the library for analog waveform generation | ||
|
||
analogWave wave(DAC); // Create an instance of the analogWave class, using the DAC pin | ||
|
||
int freq = 10; // in hertz, change accordingly | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
wave.sine(freq); | ||
Serial.begin(115200); // Initialize serial communication at a baud rate of 115200 | ||
wave.sine(freq); // Generate a sine wave with the initial frequency | ||
} | ||
|
||
void loop() { | ||
// Read an analog value from pin A5 and map it to a frequency range | ||
freq = map(analogRead(A5), 0, 1024, 0, 10000); | ||
|
||
// Print the updated frequency to the serial monitor | ||
Serial.println("Frequency is now " + String(freq) + " hz"); | ||
wave.freq(freq); | ||
delay(1000); | ||
|
||
wave.freq(freq); // Set the frequency of the waveform generator to the updated value | ||
delay(1000); // Delay for one second before repeating | ||
} |
38 changes: 28 additions & 10 deletions
38
libraries/Arduino_LED_Matrix/examples/DisplaySingleFrame/DisplaySingleFrame.ino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,39 @@ | ||
#include "Arduino_LED_Matrix.h" | ||
#include "frames.h" | ||
/* | ||
Single Frame | ||
Hannes7eicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ArduinoLEDMatrix matrix; | ||
Displays single frames using matrix.loadFrame | ||
|
||
See the full documentation here: | ||
https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix | ||
Hannes7eicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
|
||
#include "Arduino_LED_Matrix.h" // Include the library for controlling LED matrix | ||
#include "frames.h" // Include a header file containing frame data | ||
|
||
ArduinoLEDMatrix matrix; // Create an instance of the ArduinoLEDMatrix class | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
matrix.begin(); | ||
} | ||
Serial.begin(115200); // Initialize serial communication at a baud rate of 115200 | ||
matrix.begin(); // Initialize the LED matrix | ||
} | ||
Hannes7eicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
void loop() { | ||
// Load and display the "chip" frame on the LED matrix | ||
matrix.loadFrame(chip); | ||
delay(500); | ||
delay(500); // Pause for 500 milliseconds (half a second) | ||
|
||
// Load and display the "happy" frame on the LED matrix | ||
Hannes7eicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
matrix.loadFrame(danger); | ||
delay(500); | ||
delay(500); // Pause for 500 milliseconds (half a second) | ||
Hannes7eicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Load and display the "happy" frame on the LED matrix | ||
matrix.loadFrame(happy); | ||
delay(500); | ||
delay(500); // Pause for 500 milliseconds (half a second) | ||
Hannes7eicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Load and display the "heart" frame on the LED matrix | ||
matrix.loadFrame(heart); | ||
delay(500); | ||
delay(500); // Pause for 500 milliseconds (half a second) | ||
Hannes7eicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Print the current value of millis() to the serial monitor | ||
Serial.println(millis()); | ||
} |
10 changes: 10 additions & 0 deletions
10
libraries/Arduino_LED_Matrix/examples/GameOfLife/GameOfLife.ino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
libraries/Arduino_LED_Matrix/examples/PlayAnimation/PlayAnimation.ino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.