Arduino compatible board: Seeeduino Lotus (ATmega m328p).
Dimensions: 177 x 115 x 19 mm.
Original Firmware code, which is pre-installed to the board, can be found here.
All the modules have been connected to the MCU (microcontroller unit) through the PCB (printed circuit board) stamp holes. So no cables are needed to connect. Of course, you can also take the modules out and use cables.
If you are interested to learn embedded programming then this is a good starting point. All modules are already wired and it will make troubleshooting easier. If you like to build hardware then there is not much to do.
Why PlatformIO?You can do all your coding in one IDE. When I started using Visual Studio Code and PlatformIO I have abandoned all other alternatives. Using it for all different Arduino and other boards and also using Python, Go, Rust etc. coding.
Creating a projectIf you have installed Visual Studio Code and PlatformIO extension. Then it is quite easy to start the project.
Click "New Project"
Give a name and select "Seeeduino" board.
Now it creates all necessary folders and files. The most important file is "Project name/src/main.cpp" This is where all your code is.
When you download some libraries from Github you can put them in the "Project name/lib/" folder.
Another very important file is "Project name/platformio.ini" where is all PlatformIO project specific settings. Like a baud rate.
My platformio.ini file:
[env:seeeduino]
platform = atmelavr
board = seeeduino
framework = arduino
monitor_speed = 115200
There are some important buttons at the bottom of the window. Like: Build, Upload, Serial Monitor etc.
I have made one simple serial plotter python app that you can download here: github.com/taunoe/tauno-serial-plotter. It is handy to display data over serial communication (USB).
Arduino code:
#include <Arduino.h>
#include "pitches.h"
#define NTD0 -1
#define NTD1 294
#define NTD2 330
#define NTD3 350
#define NTD4 393
#define NTD5 441
#define NTD6 495
#define NTD7 556
#define NTDL1 147
#define NTDL2 165
#define NTDL3 175
#define NTDL4 196
#define NTDL5 221
#define NTDL6 248
#define NTDL7 278
#define NTDH1 589
#define NTDH2 661
#define NTDH3 700
#define NTDH4 786
#define NTDH5 882
#define NTDH6 990
#define NTDH7 112
#define DOUBLE 2
#define WHOLE 1
#define HALF 0.5
#define QUARTER 0.25
#define EIGHTH 0.25
#define SIXTEENTH 0.625
int tune[] = {
NTD3, NTD3, NTD4, NTD5,
NTD5, NTD4, NTD3, NTD2,
NTD1, NTD1, NTD2, NTD3,
NTD3, NTD2, NTD2,
NTD3, NTD3, NTD4, NTD5,
NTD5, NTD4, NTD3, NTD2,
NTD1, NTD1, NTD2, NTD3,
NTD2, NTD1, NTD1,
NTD2, NTD2, NTD3, NTD1,
NTD2, NTD3, NTD4, NTD3, NTD1,
NTD2, NTD3, NTD4, NTD3, NTD2,
NTD1, NTD2, NTDL5, NTD0,
NTD3, NTD3, NTD4, NTD5,
NTD5, NTD4, NTD3, NTD4, NTD2,
NTD1, NTD1, NTD2, NTD3,
NTD2, NTD1, NTD1};
float durt[] = {
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1 + 0.5, 0.5, 1 + 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1 + 0.5,
0.5, 1 + 1, 1, 1,
1, 1, 1, 0.5,
0.5, 1, 1, 1,
0.5, 0.5, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 0.5,
0.5, 1, 1, 1,
1, 1 + 0.5, 0.5, 1 + 1,
};
int length;
int tonepin = 5;
int ledpin = 4;
void setup()
{
Serial.begin(115200);
pinMode(tonepin, OUTPUT);
pinMode(ledpin, OUTPUT);
length = sizeof(tune) / sizeof(tune[0]);
}
void loop()
{
for (int x = 0; x < length; x++)
{
tone(tonepin, tune[x]);
Serial.println(tune[x]);
delay(400 * durt[x]);
delay(100 * durt[x]);
noTone(tonepin);
}
delay(4000);
}
Links
Comments
Please log in or sign up to comment.