File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
cpp_Arduino_wave_generator
builds/Adafruit_feather_m4_express Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change
1
+ COM5
Original file line number Diff line number Diff line change 1
1
/* ******************************************************************************
2
2
Dennis van Gils
3
- 23-06 -2020
3
+ 14-07 -2020
4
4
******************************************************************************/
5
5
6
6
#include < Arduino.h>
7
7
#include < math.h>
8
8
#include " DvG_SerialCommand.h"
9
9
10
+ // On the Arduino M0 Pro:
10
11
// Serial : Programming USB port
11
12
// SerialUSB: Native USB port. Baudrate setting gets ignored and is always as
12
13
// fast as possible.
@@ -44,7 +45,7 @@ void loop() {
44
45
// Generate wave sample every millisecond
45
46
curMillis = millis ();
46
47
if (curMillis - prevMillis >= 1 ) {
47
-
48
+
48
49
if (wave_type == WAVE_SINE) {
49
50
wave = sin (2 *PI*wave_freq*curMillis/1e3 );
50
51
} else if (wave_type == WAVE_SQUARE) {
@@ -61,8 +62,8 @@ void loop() {
61
62
strCmd = sc.getCmd ();
62
63
63
64
if (strcmp (strCmd, " id?" ) == 0 ) {
64
- Ser.println (" Wave generator" );
65
-
65
+ Ser.println (" Arduino, Wave generator" );
66
+
66
67
} else if (strcmp (strCmd, " sine" ) == 0 ) {
67
68
wave_type = WAVE_SINE;
68
69
} else if (strcmp (strCmd, " square" ) == 0 ) {
You can’t perform that action at this time.
0 commit comments