Copy the below code and paste to your Arduino IDE, and upload to
your Seeeduino V4. After upload the code to an Arduino, then open
the Serial monitor.
1/* Grove - Recorder Test Code
2+-------------------------------------------------------
3| Open Serial Monitor and input command to control the
4| r - start recording
5| s - stop recording
6| p - play
7+-------------------------------------------------------
8
9const int pinRec = 3;
10 const int pinPlay = 2;
11
12 void setup()
13 {
14 Serial.begin(115200);
15 Serial.println("Grove - Recorder V3.0 Test Code");
16 Serial.println("cmd: \r\nr: record\r\ns: stop recordi
17
18 pinMode(pinRec, OUTPUT);
19 pinMode(pinPlay, OUTPUT);
20 digitalWrite(pinRec, HIGH);
21 digitalWrite(pinPlay, HIGH);
22 }
23
24 void loop()
25 {
26 if(Serial.available())
27 {
28 char c = Serial.read();
29 if(c == 'r') // begin to record
30 {
31 digitalWrite(pinRec, LOW);
32 Serial.println("start recording...");
33 }
34 else if(c == 's') // stop recording
35 {