Skip to content

Commit 88bf01e

Browse files
committed
Apply Per's feedback and add more comments
1 parent 34218c9 commit 88bf01e

File tree

31 files changed

+270
-137
lines changed

31 files changed

+270
-137
lines changed

libraries/AnalogWave/examples/DACEqualTemperedScale/DACEqualTemperedScale.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
created 18 Dec 2018
2222
modified 3 Jul 2023
2323
by Tom Igoe
24+
25+
See the full documentation here:
26+
https://docs.arduino.cc/tutorials/uno-r4-wifi/dac
2427
*/
2528

2629
// include the AnalogWave library:

libraries/AnalogWave/examples/DACJacques/DACJacques.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
DAC Melody player
33
44
Generates a series of tones from MIDI note values
@@ -14,6 +14,9 @@ circuit:
1414
created 13 Feb 2017
1515
modified 3 Jul 2023
1616
by Tom Igoe
17+
18+
See the full documentation here:
19+
https://docs.arduino.cc/tutorials/uno-r4-wifi/dac
1720
*/
1821
#include "analogWave.h"
1922
analogWave wave(DAC);

libraries/AnalogWave/examples/SineWave/SineWave.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Generates a pre-generated sawtooth-waveform.
55
6-
See the full documentatio here:
6+
See the full documentation here:
77
https://docs.arduino.cc/tutorials/uno-r4-wifi/dac
88
*/
99

libraries/Arduino_CAN/examples/CANRead/CANRead.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
CANRead
3+
4+
Receive and read CAN Bus messages
5+
6+
See the full documentation here:
7+
https://docs.arduino.cc/tutorials/uno-r4-wifi/can
8+
*/
9+
110
/**************************************************************************************
211
* INCLUDE
312
**************************************************************************************/

libraries/Arduino_CAN/examples/CANWrite/CANWrite.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
CANWrite
3+
4+
Write and send CAN Bus messages
5+
6+
See the full documentation here:
7+
https://docs.arduino.cc/tutorials/uno-r4-wifi/can
8+
*/
9+
110
/**************************************************************************************
211
* INCLUDE
312
**************************************************************************************/

libraries/Arduino_FreeRTOS/examples/FreeRTOS-Blink/FreeRTOS-Blink.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
The code demonstrates the usage of FreeRTOS (Real-Time Operating System) to run concurrent tasks.
3+
4+
One task is responsible for running the loop() logic (in a thread-safe manner),
5+
while the other task blinks an LED using the built-in LED on non-Portenta boards or
6+
the RGB LED on the Portenta C33 board.
7+
*/
8+
19
/**************************************************************************************
210
* INCLUDE
311
**************************************************************************************/

libraries/Arduino_LED_Matrix/examples/DisplaySingleFrame/DisplaySingleFrame.ino

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
/*
2-
Single Frame
3-
4-
Displays single frames using matrix.loadFrame
5-
6-
See the full documentation here:
7-
https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix
2+
Single Frame
3+
4+
Displays single frames using matrix.loadFrame
5+
6+
See the full documentation here:
7+
https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix
88
*/
99

10-
#include "Arduino_LED_Matrix.h" // Include the library for controlling LED matrix
10+
#include "Arduino_LED_Matrix.h" // Include the LED_Matrix library
1111
#include "frames.h" // Include a header file containing frame data
1212

1313
ArduinoLEDMatrix matrix; // Create an instance of the ArduinoLEDMatrix class
1414

1515
void setup() {
1616
Serial.begin(115200); // Initialize serial communication at a baud rate of 115200
1717
matrix.begin(); // Initialize the LED matrix
18-
}
18+
}
1919

2020
void loop() {
2121
// Load and display the "chip" frame on the LED matrix
2222
matrix.loadFrame(chip);
2323
delay(500); // Pause for 500 milliseconds (half a second)
2424

25-
// Load and display the "happy" frame on the LED matrix
25+
// Load and display the "danger" frame on the LED matrix
2626
matrix.loadFrame(danger);
27-
delay(500); // Pause for 500 milliseconds (half a second)
27+
delay(500);
2828

2929
// Load and display the "happy" frame on the LED matrix
3030
matrix.loadFrame(happy);
31-
delay(500); // Pause for 500 milliseconds (half a second)
31+
delay(500);
3232

3333
// Load and display the "heart" frame on the LED matrix
3434
matrix.loadFrame(heart);
35-
delay(500); // Pause for 500 milliseconds (half a second)
35+
delay(500);
3636

3737
// Print the current value of millis() to the serial monitor
3838
Serial.println(millis());

libraries/Arduino_LED_Matrix/examples/GameOfLife/GameOfLife.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix
1414
*/
1515

16-
#include "Arduino_LED_Matrix.h"
16+
#include "Arduino_LED_Matrix.h" // Include the LED_Matrix library
1717

1818
// grid dimensions. should not be larger than 8x8
1919
#define MAX_Y 8

libraries/Arduino_LED_Matrix/examples/LivePreview/LivePreview.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix
1111
*/
1212

13-
#include "Arduino_LED_Matrix.h" // Include the library for controlling LED matrix
13+
#include "Arduino_LED_Matrix.h" // Include the LED_Matrix library
1414

1515
ArduinoLEDMatrix matrix; // Create an instance of the ArduinoLEDMatrix class
1616

@@ -35,4 +35,4 @@ void loop() {
3535
// Load and display the received frame data on the LED matrix
3636
matrix.loadFrame(frame);
3737
}
38-
}
38+
}
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/*
2-
Matrix Frame Buffer
3-
4-
This Arduino sketch demonstrates the creation and manipulation of
5-
a frame buffer for the LED matrix. The frame buffer is used to control
6-
the lighting of individual LEDs on the matrix, turning them randomly on and off.
7-
8-
See the full documentation here:
9-
https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix
2+
Matrix Frame Buffer
3+
4+
This Arduino sketch demonstrates the creation and manipulation of
5+
a frame buffer for the LED matrix. The frame buffer is used to control
6+
the lighting of individual LEDs on the matrix, turning them randomly on and off.
7+
8+
See the full documentation here:
9+
https://docs.arduino.cc/tutorials/uno-r4-wifi/led-matrix
1010
*/
1111

12-
// Include the Arduino_LED_Matrix library
13-
#include "Arduino_LED_Matrix.h"
12+
// Include the LED_Matrix library
13+
#include "Arduino_LED_Matrix.h"
1414

15-
// Creating an instance of the ArduinoLEDMatrix class
16-
ArduinoLEDMatrix matrix;
15+
// Create an instance of the ArduinoLEDMatrix class
16+
ArduinoLEDMatrix matrix;
1717

18-
// Defining the frame array for the LED matrix with pixel values
18+
// Define the frame array for the LED matrix with pixel values
1919
uint8_t frame[8][12] = {
20-
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
20+
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
2121
{ 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 },
2222
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
2323
{ 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
@@ -27,7 +27,7 @@ uint8_t frame[8][12] = {
2727
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
2828
};
2929

30-
// Setting up time intervals and dimensions for the matrix
30+
// Set up time intervals and dimensions for the matrix
3131
unsigned long lastTickTime, lastGameTickTime;
3232
#define UPDATE_INTERVAL 100
3333
#define GAME_UPDATE_INTERVAL 66
@@ -39,24 +39,24 @@ unsigned long lastTickTime, lastGameTickTime;
3939
uint8_t pointX = 0, pointY = 0;
4040

4141
void setup() {
42-
// Initializing serial communication and delaying for setup
42+
// Initialize serial communication and delaying for setup
4343
Serial.begin(115200);
4444
delay(1500);
4545

46-
// Initializing the LED matrix
46+
// Initialize the LED matrix
4747
matrix.begin();
4848

49-
// Initializing time tracking variables
49+
// Initialize time tracking variables
5050
lastGameTickTime = lastTickTime = millis();
5151
}
5252

5353
void loop() {
54-
// Tracking the current time
54+
// Track the current time
5555
unsigned long msNow = millis();
5656

57-
// Updating the game logic with a fixed interval
57+
// Update the game logic with a fixed interval
5858
if (msNow - lastGameTickTime > GAME_UPDATE_INTERVAL) {
59-
// Incrementing pointX and handling wraparound
59+
// Increment pointX and handling wraparound
6060
pointX++;
6161
if (pointX >= COLUMNS) {
6262
pointX = 0;
@@ -66,23 +66,23 @@ void loop() {
6666
}
6767
}
6868

69-
// Generating random positions and pixel value
69+
// Generate random positions and pixel value
7070
pointX = random(COLUMNS);
7171
pointY = random(ROWS);
7272
uint8_t pixelValue = random(2);
7373

74-
// Updating the frame with the new pixel value
74+
// Update the frame with the new pixel value
7575
frame[pointY][pointX] = pixelValue;
7676

77-
// Updating the last game tick time
77+
// Update the last game tick time
7878
lastGameTickTime = msNow;
7979
}
8080

81-
// Rendering the LED matrix with the current frame at a fixed interval
81+
// Render the LED matrix with the current frame at a fixed interval
8282
if (msNow - lastTickTime > UPDATE_INTERVAL) {
8383
matrix.renderBitmap(frame, 8, 12);
8484

85-
// Updating the last rendering tick time
85+
// Update the last rendering tick time
8686
lastTickTime = msNow;
8787
}
8888
}

0 commit comments

Comments
 (0)