@@ -45,7 +45,7 @@ static void glow(char *buf, int len, int argc, char **argv) {
4545 int rc = bl_pwm_init (
4646 PWM_CHANNEL , // PWM Channel (1)
4747 LED_GPIO , // GPIO Pin Number (11)
48- 2000 // PWM Frequency (2000 Hz)
48+ 2000 // PWM Frequency (2,000 Hz)
4949 );
5050 assert (rc == 0 );
5151
@@ -56,8 +56,7 @@ static void glow(char *buf, int len, int argc, char **argv) {
5656 );
5757 assert (rc == 0 );
5858
59- // Start the PWM, which will blink the LED very rapidly
60- // pwm_start 1
59+ // Start the PWM, which will blink the LED very rapidly (2,000 times a second)
6160 rc = bl_pwm_start (PWM_CHANNEL );
6261 assert (rc == 0 );
6362
@@ -67,7 +66,7 @@ static void glow(char *buf, int len, int argc, char **argv) {
6766 float output = run_inference (input );
6867
6968 // Output value has range -1 to 1.
70- // We sqaure the output value to produce range 0 to 1.
69+ // We square the output value to produce range 0 to 1.
7170 float output_squared = output * output ;
7271
7372 // Set the brightness (Duty Cycle) of the PWM LED to the
@@ -78,7 +77,7 @@ static void glow(char *buf, int len, int argc, char **argv) {
7877 );
7978 assert (rc == 0 );
8079
81- // We flip the brightness (output squared) because...
80+ // We flip the brightness (1 - output squared) because...
8281 // Duty Cycle = 0% means 100% brightness
8382 // Duty Cycle = 100% means 0% brightness
8483
0 commit comments