Skip to content

Commit 035c1b6

Browse files
Conform dvg_devices.BaseDevice.SerialDevice
1 parent c8049fc commit 035c1b6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

config/port.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COM5
Binary file not shown.

cpp_Arduino_wave_generator/src/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
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) {

0 commit comments

Comments
 (0)