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 11/* ******************************************************************************
22 Dennis van Gils
3- 23-06 -2020
3+ 14-07 -2020
44 ******************************************************************************/
55
66#include < Arduino.h>
77#include < math.h>
88#include " DvG_SerialCommand.h"
99
10+ // On the Arduino M0 Pro:
1011// Serial : Programming USB port
1112// SerialUSB: Native USB port. Baudrate setting gets ignored and is always as
1213// fast as possible.
@@ -44,7 +45,7 @@ void loop() {
4445 // Generate wave sample every millisecond
4546 curMillis = millis ();
4647 if (curMillis - prevMillis >= 1 ) {
47-
48+
4849 if (wave_type == WAVE_SINE) {
4950 wave = sin (2 *PI*wave_freq*curMillis/1e3 );
5051 } else if (wave_type == WAVE_SQUARE) {
@@ -61,8 +62,8 @@ void loop() {
6162 strCmd = sc.getCmd ();
6263
6364 if (strcmp (strCmd, " id?" ) == 0 ) {
64- Ser.println (" Wave generator" );
65-
65+ Ser.println (" Arduino, Wave generator" );
66+
6667 } else if (strcmp (strCmd, " sine" ) == 0 ) {
6768 wave_type = WAVE_SINE;
6869 } else if (strcmp (strCmd, " square" ) == 0 ) {
You can’t perform that action at this time.
0 commit comments