Skip to content

Commit 1802988

Browse files
committed
2 parents 342969c + c074057 commit 1802988

File tree

2 files changed

+66
-44
lines changed

2 files changed

+66
-44
lines changed

Diff for: docs/examples/arduino-mega-uart-dlog/arduino-mega-uart-dlog.ino

-44
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* An example of how to initiate DLOG session and record voltage and current on CH1
3+
* WARNING: CH1 output current will be set to 2 A, and voltage will vary between 5 and 10 V.
4+
* Please use simple load such as power resistor for the test.
5+
*
6+
* Tested with Arduino Mega 2560 and Due. Use UART1: pin 18 -> BB3 DIN1, pin 19 -> BB3 DOUT1
7+
*
8+
*/
9+
10+
void setup() {
11+
// setup serial
12+
Serial1.begin(115200, SERIAL_8E2);
13+
14+
// Intro message
15+
delay(1000);
16+
Serial1.println("DISP:TEXT 'Arduino here, you are under my control!'");
17+
delay(2000);
18+
Serial1.println("DISP:TEXT:CLE"); // clear message
19+
delay(1000);
20+
21+
// init dlog
22+
Serial1.println("SENS:DLOG:PER 0.01");
23+
Serial1.println("SENS:DLOG:TIME 60");
24+
Serial1.println("SENS:DLOG:FUNC:VOLT ON, CH1");
25+
Serial1.println("SENS:DLOG:FUNC:CURR ON, CH1");
26+
Serial1.println("INIT:DLOG '/Recordings/arduino-dlog-bookmarks.dlog'");
27+
// set CH1 params
28+
Serial1.println("INST CH1");
29+
Serial1.println("CURR 2");
30+
Serial1.println("OUTP 1");
31+
// wait 1sec
32+
delay(1000);
33+
34+
// add "start" bookmark
35+
Serial1.println("SENS:DLOG:TRAC:BOOK 'Start'");
36+
37+
// change output voltage 5 times on CH1
38+
for (int i = 0; i < 5; i++) {
39+
Serial1.println("VOLT 10");
40+
delay(500);
41+
Serial1.println("VOLT 5");
42+
delay(1000);
43+
}
44+
45+
// add "pause" bookmark
46+
Serial1.println("SENS:DLOG:TRAC:BOOK 'Pause'");
47+
delay (3000);
48+
49+
// add "stop" bookmark
50+
Serial1.println("SENS:DLOG:TRAC:BOOK 'Stop'");
51+
52+
// wait 1sec
53+
delay(1000);
54+
55+
// abort dlog
56+
Serial1.println("ABOR:DLOG");
57+
58+
// Goodbye message
59+
delay(1000);
60+
Serial1.println("DISP:TEXT 'I am checking out, you are free again!'");
61+
delay(5000);
62+
Serial1.println("DISP:TEXT:CLE"); // clear message
63+
}
64+
65+
void loop() {
66+
}

0 commit comments

Comments
 (0)