translating-pt-br
This commit is contained in:
parent
2070df4e8c
commit
3b40cd8555
168
m5stick-nemo.ino
168
m5stick-nemo.ino
|
@ -13,8 +13,77 @@ String buildver="2.3.3";
|
||||||
#define FGCOLOR GREEN
|
#define FGCOLOR GREEN
|
||||||
|
|
||||||
// -=-=- NEMO Portal Language -=- Thanks, @marivaaldo! -=-=-
|
// -=-=- NEMO Portal Language -=- Thanks, @marivaaldo! -=-=-
|
||||||
#define LANGUAGE_EN_US
|
//define LANGUAGE_EN_US
|
||||||
//#define LANGUAGE_PT_BR
|
#define LANGUAGE_PT_BR
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(LANGUAGE_EN_US)
|
||||||
|
#define TXT_BACK "Back"
|
||||||
|
#define TXT_CLOCK "Clock"
|
||||||
|
#define TXT_SETTINGS "Settings"
|
||||||
|
#define TXT_NEVER "Never"
|
||||||
|
#define TXT_SEC "seconds"
|
||||||
|
#define TXT_MIN "minutes"
|
||||||
|
#define TXT_AUTO_DIM "SET AUTO DIM TIME"
|
||||||
|
#define TXT_SET_BRIGHT "SET BRIGHTNESS"
|
||||||
|
#define TXT_BATT_INFO "Battery Info"
|
||||||
|
#define TXT_BRIGHT "Brightness"
|
||||||
|
#define TXT_SET_CLOCK "Set Clock"
|
||||||
|
#define TXT_ROTATION "Rotation"
|
||||||
|
#define TXT_ABOUT "About"
|
||||||
|
#define TXT_REBOOT "Reboot"
|
||||||
|
#define TXT_CLR_SETTINGS "Clear Settings"
|
||||||
|
#define TXT_CLRING_SETTINGS "Restoring Default\nSettings..."
|
||||||
|
#define TXT_RIGHT "Right"
|
||||||
|
#define TXT_LEFT "Left"
|
||||||
|
#define TXT_BATT "Battery: "
|
||||||
|
#define TXT_EXIT "Press any button to exit"
|
||||||
|
#define TXT_RG_AMERICAS "Region:\nAmericas / Asia\n"
|
||||||
|
#define TXT_RG_EMEA "Region: EMEA"
|
||||||
|
#define TXT_SEL_GO_PAUSE "Select: Go/Pause"
|
||||||
|
#define TXT_SEL_EXIT "Next: Exit"
|
||||||
|
#define TXT_TRIG_TV "triggered TVBG"
|
||||||
|
#define TXT_MN_AMERICA "Americas / Asia"
|
||||||
|
#define TXT_MN_EMEA "EU/MidEast/Africa"
|
||||||
|
#define TXT_REGION "Region"
|
||||||
|
#define TXT_FK_GP "Front Key: Go/Pause"
|
||||||
|
#define TXT_SET_HOUR "SET HOUR"
|
||||||
|
#define TXT_SET_MIN "SET MINUTE"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(LANGUAGE_PT_BR)
|
||||||
|
#define TXT_BACK "Voltar"
|
||||||
|
#define TXT_CLOCK "Relogio"
|
||||||
|
#define TXT_SETTINGS "Configuracoes"
|
||||||
|
#define TXT_NEVER "Nunca"
|
||||||
|
#define TXT_SEC "segundos"
|
||||||
|
#define TXT_MIN "minutos"
|
||||||
|
#define TXT_AUTO_DIM "AJUSTAR LUZ DE FUNDO"
|
||||||
|
#define TXT_SET_BRIGHT "BRILHO DA TELA"
|
||||||
|
#define TXT_BATT_INFO "Estado da Bateria"
|
||||||
|
#define TXT_BRIGHT "Brilho"
|
||||||
|
#define TXT_SET_CLOCK "Ajustar Relogio"
|
||||||
|
#define TXT_ROTATION "Rotacao"
|
||||||
|
#define TXT_ABOUT "Sobre"
|
||||||
|
#define TXT_REBOOT "Reiniciar M5"
|
||||||
|
#define TXT_CLR_SETTINGS "Resetar Ajustes"
|
||||||
|
#define TXT_CLRING_SETTINGS "Aplicando Ajustes\nPadrao..."
|
||||||
|
#define TXT_RIGHT "Direita"
|
||||||
|
#define TXT_LEFT "Esquerda"
|
||||||
|
#define TXT_BATT "Bateria: "
|
||||||
|
#define TXT_EXIT "Pressione qualquer botao para sair"
|
||||||
|
#define TXT_RG_AMERICAS "Regiao:\nAmericas / Asia\n"
|
||||||
|
#define TXT_RG_EMEA "Regiao: EMEA"
|
||||||
|
#define TXT_SEL_GO_PAUSE "Select:Iniciar/Parar"
|
||||||
|
#define TXT_SEL_EXIT "Next: Sair"
|
||||||
|
#define TXT_TRIG_TV "TVBG em funcionamento..."
|
||||||
|
#define TXT_MN_AMERICA "Americas/Asia"
|
||||||
|
#define TXT_MN_EMEA "EU/MidEast/Africa"
|
||||||
|
#define TXT_REGION "Regiao"
|
||||||
|
#define TXT_FK_GP "Botao Frontal:Iniciar/Pausar"
|
||||||
|
#define TXT_SET_HOUR "AJUSTAR HORA"
|
||||||
|
#define TXT_SET_MIN "AJUSTAR MINUTO"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(STICK_C_PLUS)
|
#if defined(STICK_C_PLUS)
|
||||||
#include <M5StickCPlus.h>
|
#include <M5StickCPlus.h>
|
||||||
|
@ -187,6 +256,7 @@ bool isSwitching = true;
|
||||||
#include "sd.h"
|
#include "sd.h"
|
||||||
#include "portal.h"
|
#include "portal.h"
|
||||||
#include "NEMOMatrix.h"
|
#include "NEMOMatrix.h"
|
||||||
|
#include "songs.h"
|
||||||
#include <BLEUtils.h>
|
#include <BLEUtils.h>
|
||||||
#include <BLEServer.h>
|
#include <BLEServer.h>
|
||||||
|
|
||||||
|
@ -201,7 +271,7 @@ struct QRCODE {
|
||||||
};
|
};
|
||||||
|
|
||||||
QRCODE qrcodes[] = {
|
QRCODE qrcodes[] = {
|
||||||
{ "Back", "" },
|
{ TXT_BACK, "" },
|
||||||
{ "Rickroll", "https://youtu.be/dQw4w9WgXcQ"},
|
{ "Rickroll", "https://youtu.be/dQw4w9WgXcQ"},
|
||||||
{ "HackerTyper", "https://hackertyper.net/"},
|
{ "HackerTyper", "https://hackertyper.net/"},
|
||||||
{ "ZomboCom", "https://html5zombo.com/"},
|
{ "ZomboCom", "https://html5zombo.com/"},
|
||||||
|
@ -324,13 +394,13 @@ bool check_select_press(){
|
||||||
/// MAIN MENU ///
|
/// MAIN MENU ///
|
||||||
MENU mmenu[] = {
|
MENU mmenu[] = {
|
||||||
#if defined(RTC)
|
#if defined(RTC)
|
||||||
{ "Clock", 0},
|
{ TXT_CLOCK, 0},
|
||||||
#endif
|
#endif
|
||||||
{ "TV-B-Gone", 13}, // We jump to the region menu first
|
{ "TV-B-Gone", 13}, // We jump to the region menu first
|
||||||
{ "Bluetooth", 16},
|
{ "Bluetooth", 16},
|
||||||
{ "WiFi", 12},
|
{ "WiFi", 12},
|
||||||
{ "QR Codes", 18},
|
{ "QR Codes", 18},
|
||||||
{ "Settings", 2},
|
{ TXT_SETTINGS, 2},
|
||||||
};
|
};
|
||||||
int mmenu_size = sizeof(mmenu) / sizeof(MENU);
|
int mmenu_size = sizeof(mmenu) / sizeof(MENU);
|
||||||
|
|
||||||
|
@ -393,22 +463,22 @@ void screen_dim_proc() {
|
||||||
|
|
||||||
/// Dimmer MENU ///
|
/// Dimmer MENU ///
|
||||||
MENU dmenu[] = {
|
MENU dmenu[] = {
|
||||||
{ "Back", screen_dim_time},
|
{ TXT_BACK, screen_dim_time},
|
||||||
{ "Never", 0},
|
{ TXT_NEVER, 0},
|
||||||
{ "5 seconds", 5},
|
{ ("5 " TXT_SEC), 5},
|
||||||
{ "10 seconds", 10},
|
{ ("10 " TXT_SEC), 10},
|
||||||
{ "15 seconds", 15},
|
{ ("15 " TXT_SEC), 15},
|
||||||
{ "30 seconds", 30},
|
{ ("30 " TXT_SEC), 30},
|
||||||
{ "1 minute", 60},
|
{ ("60 " TXT_SEC), 60},
|
||||||
{ "2 minutes", 120},
|
{ ("120 " TXT_MIN), 120},
|
||||||
{ "4 minutes", 240},
|
{ ("240 " TXT_MIN), 240},
|
||||||
};
|
};
|
||||||
int dmenu_size = sizeof(dmenu) / sizeof(MENU);
|
int dmenu_size = sizeof(dmenu) / sizeof(MENU);
|
||||||
|
|
||||||
void dmenu_setup() {
|
void dmenu_setup() {
|
||||||
DISP.fillScreen(BGCOLOR);
|
DISP.fillScreen(BGCOLOR);
|
||||||
DISP.setCursor(0, 5, 1);
|
DISP.setCursor(0, 5, 1);
|
||||||
DISP.println("SET AUTO DIM TIME");
|
DISP.println(String(TXT_AUTO_DIM));
|
||||||
delay(1000);
|
delay(1000);
|
||||||
cursor = 0;
|
cursor = 0;
|
||||||
rstOverride = true;
|
rstOverride = true;
|
||||||
|
@ -431,7 +501,7 @@ void dmenu_loop() {
|
||||||
#endif
|
#endif
|
||||||
DISP.fillScreen(BGCOLOR);
|
DISP.fillScreen(BGCOLOR);
|
||||||
DISP.setCursor(0, 5, 1);
|
DISP.setCursor(0, 5, 1);
|
||||||
DISP.println("SET BRIGHTNESS");
|
DISP.println(String(TXT_SET_BRIGHT));
|
||||||
delay(1000);
|
delay(1000);
|
||||||
cursor = brightness / 10;
|
cursor = brightness / 10;
|
||||||
number_drawmenu(11);
|
number_drawmenu(11);
|
||||||
|
@ -457,24 +527,23 @@ void dmenu_loop() {
|
||||||
|
|
||||||
/// SETTINGS MENU ///
|
/// SETTINGS MENU ///
|
||||||
MENU smenu[] = {
|
MENU smenu[] = {
|
||||||
{ "Back", 1},
|
{ TXT_BACK, 1},
|
||||||
#if defined(AXP)
|
#if defined(AXP)
|
||||||
{ "Battery Info", 6},
|
{ TXT_BATT_INFO, 6},
|
||||||
#endif
|
#endif
|
||||||
{ "Brightness", 4},
|
{ TXT_BRIGHT, 4},
|
||||||
#if defined(RTC)
|
#if defined(RTC)
|
||||||
{ "Set Clock", 3},
|
{ TXT_SET_CLOCK, 3},
|
||||||
#endif
|
#endif
|
||||||
#if defined(ROTATION)
|
#if defined(ROTATION)
|
||||||
{ "Rotation", 7},
|
{ XT_ROTATION, 7},
|
||||||
#endif
|
#endif
|
||||||
{ "About", 10},
|
{ TXT_ABOUT, 10},
|
||||||
{ "Reboot", 98},
|
{ TXT_REBOOT, 98},
|
||||||
#if defined(USE_EEPROM)
|
#if defined(USE_EEPROM)
|
||||||
{ "Clear Settings", 99},
|
{ TXT_CLR_SETTINGS, 99},
|
||||||
#endif
|
#endif
|
||||||
};
|
};int smenu_size = sizeof(smenu) / sizeof (MENU);
|
||||||
int smenu_size = sizeof(smenu) / sizeof (MENU);
|
|
||||||
|
|
||||||
void smenu_setup() {
|
void smenu_setup() {
|
||||||
cursor = 0;
|
cursor = 0;
|
||||||
|
@ -499,7 +568,7 @@ void clearSettings(){
|
||||||
DISP.println("M5-NEMO");
|
DISP.println("M5-NEMO");
|
||||||
DISP.setTextColor(WHITE, BLUE);
|
DISP.setTextColor(WHITE, BLUE);
|
||||||
DISP.setTextSize(SMALL_TEXT);
|
DISP.setTextSize(SMALL_TEXT);
|
||||||
DISP.println("Restoring Default\nSettings...");
|
DISP.println(TXT_CLRING_SETTINGS);
|
||||||
delay(5000);
|
delay(5000);
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
|
@ -528,9 +597,9 @@ int rotation = 1;
|
||||||
#if defined(ROTATION)
|
#if defined(ROTATION)
|
||||||
/// Rotation MENU ///
|
/// Rotation MENU ///
|
||||||
MENU rmenu[] = {
|
MENU rmenu[] = {
|
||||||
{ "Back", rotation},
|
{ TXT_BACK, rotation},
|
||||||
{ "Right", 1},
|
{ TXT_RIGHT, 1},
|
||||||
{ "Left", 3},
|
{ TXT_LEFT, 3},
|
||||||
};
|
};
|
||||||
int rmenu_size = sizeof(rmenu) / sizeof (MENU);
|
int rmenu_size = sizeof(rmenu) / sizeof (MENU);
|
||||||
|
|
||||||
|
@ -569,7 +638,7 @@ int rotation = 1;
|
||||||
DISP.setTextSize(SMALL_TEXT);
|
DISP.setTextSize(SMALL_TEXT);
|
||||||
DISP.fillScreen(BGCOLOR);
|
DISP.fillScreen(BGCOLOR);
|
||||||
DISP.setCursor(0, 8, 1);
|
DISP.setCursor(0, 8, 1);
|
||||||
DISP.print("Battery: ");
|
DISP.print(TXT_BATT);
|
||||||
DISP.print(battery);
|
DISP.print(battery);
|
||||||
DISP.println("%");
|
DISP.println("%");
|
||||||
DISP.print("DeltaB: ");
|
DISP.print("DeltaB: ");
|
||||||
|
@ -577,7 +646,7 @@ int rotation = 1;
|
||||||
DISP.print("DeltaC: ");
|
DISP.print("DeltaC: ");
|
||||||
DISP.println(c);
|
DISP.println(c);
|
||||||
DISP.println("");
|
DISP.println("");
|
||||||
DISP.println("Press any button to exit");
|
DISP.println(TXT_EXIT);
|
||||||
}
|
}
|
||||||
void battery_setup() {
|
void battery_setup() {
|
||||||
rstOverride = false;
|
rstOverride = false;
|
||||||
|
@ -618,13 +687,13 @@ void tvbgone_setup() {
|
||||||
|
|
||||||
delay_ten_us(5000);
|
delay_ten_us(5000);
|
||||||
if(region == NA) {
|
if(region == NA) {
|
||||||
DISP.print("Region:\nAmericas / Asia\n");
|
DISP.print(TXT_RG_AMERICAS);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DISP.println("Region: EMEA");
|
DISP.println(TXT_RG_EMEA);
|
||||||
}
|
}
|
||||||
DISP.println("Select: Go/Pause");
|
DISP.println(TXT_SEL_GO_PAUSE);
|
||||||
DISP.println("Next: Exit");
|
DISP.println(TXT_SEL_EXIT);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,16 +701,16 @@ void tvbgone_loop()
|
||||||
{
|
{
|
||||||
if (check_select_press()) {
|
if (check_select_press()) {
|
||||||
delay(250);
|
delay(250);
|
||||||
Serial.println("triggered TVBG");
|
Serial.println(TXT_TRIG_TV);
|
||||||
sendAllCodes();
|
sendAllCodes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TVBG-Region MENU ///
|
/// TVBG-Region MENU ///
|
||||||
MENU tvbgmenu[] = {
|
MENU tvbgmenu[] = {
|
||||||
{ "Back", 3},
|
{ TXT_BACK, 3},
|
||||||
{ "Americas / Asia", 0},
|
{ TXT_MN_AMERICA, 0},
|
||||||
{ "EU/MidEast/Africa", 1},
|
{ TXT_MN_EMEA, 1},
|
||||||
};
|
};
|
||||||
int tvbgmenu_size = sizeof(tvbgmenu) / sizeof (MENU);
|
int tvbgmenu_size = sizeof(tvbgmenu) / sizeof (MENU);
|
||||||
|
|
||||||
|
@ -651,7 +720,7 @@ void tvbgmenu_setup() {
|
||||||
DISP.setCursor(5, 1);
|
DISP.setCursor(5, 1);
|
||||||
DISP.println("TV-B-Gone");
|
DISP.println("TV-B-Gone");
|
||||||
DISP.setTextSize(MEDIUM_TEXT);
|
DISP.setTextSize(MEDIUM_TEXT);
|
||||||
DISP.println("Region");
|
DISP.println(TXT_REGION);
|
||||||
cursor = region % 2;
|
cursor = region % 2;
|
||||||
rstOverride = true;
|
rstOverride = true;
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
@ -707,7 +776,7 @@ void sendAllCodes() {
|
||||||
DISP.setCursor(5, 1);
|
DISP.setCursor(5, 1);
|
||||||
DISP.println("TV-B-Gone");
|
DISP.println("TV-B-Gone");
|
||||||
DISP.setTextSize(SMALL_TEXT);
|
DISP.setTextSize(SMALL_TEXT);
|
||||||
DISP.println("Front Key: Go/Pause");
|
DISP.println(TXT_FK_GP);
|
||||||
const uint8_t bitcompression = powerCode->bitcompression;
|
const uint8_t bitcompression = powerCode->bitcompression;
|
||||||
code_ptr = 0;
|
code_ptr = 0;
|
||||||
for (uint8_t k = 0; k < numpairs; k++) {
|
for (uint8_t k = 0; k < numpairs; k++) {
|
||||||
|
@ -762,8 +831,8 @@ void sendAllCodes() {
|
||||||
DISP.setCursor(5, 1);
|
DISP.setCursor(5, 1);
|
||||||
DISP.println("TV-B-Gone");
|
DISP.println("TV-B-Gone");
|
||||||
DISP.setTextSize(SMALL_TEXT);
|
DISP.setTextSize(SMALL_TEXT);
|
||||||
DISP.println("Select: Go/Pause");
|
DISP.println(TXT_SEL_GO_PAUSE);
|
||||||
DISP.println("Next: Exit");
|
DISP.println(TXT_SEL_EXIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CLOCK ///
|
/// CLOCK ///
|
||||||
|
@ -787,7 +856,7 @@ void sendAllCodes() {
|
||||||
rstOverride = true;
|
rstOverride = true;
|
||||||
DISP.fillScreen(BGCOLOR);
|
DISP.fillScreen(BGCOLOR);
|
||||||
DISP.setCursor(0, 5, 1);
|
DISP.setCursor(0, 5, 1);
|
||||||
DISP.println("SET HOUR");
|
DISP.println(TXT_SET_HOUR);
|
||||||
delay(2000);
|
delay(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -806,7 +875,7 @@ void sendAllCodes() {
|
||||||
int hour = cursor;
|
int hour = cursor;
|
||||||
DISP.fillScreen(BGCOLOR);
|
DISP.fillScreen(BGCOLOR);
|
||||||
DISP.setCursor(0, 5, 1);
|
DISP.setCursor(0, 5, 1);
|
||||||
DISP.println("SET MINUTE");
|
DISP.println(TXT_SET_MIN);
|
||||||
delay(2000);
|
delay(2000);
|
||||||
cursor = M5.Rtc.Minute;
|
cursor = M5.Rtc.Minute;
|
||||||
number_drawmenu(60);
|
number_drawmenu(60);
|
||||||
|
@ -837,7 +906,7 @@ void sendAllCodes() {
|
||||||
/// Bluetooth Spamming ///
|
/// Bluetooth Spamming ///
|
||||||
/// BTSPAM MENU ///
|
/// BTSPAM MENU ///
|
||||||
MENU btmenu[] = {
|
MENU btmenu[] = {
|
||||||
{ "Back", 5},
|
{ TXT_BACK, 5},
|
||||||
{ "AppleJuice", 0},
|
{ "AppleJuice", 0},
|
||||||
{ "Swift Pair", 1},
|
{ "Swift Pair", 1},
|
||||||
{ "Android Spam", 4},
|
{ "Android Spam", 4},
|
||||||
|
@ -1376,7 +1445,7 @@ void btmaelstrom_loop(){
|
||||||
|
|
||||||
/// WIFI MENU ///
|
/// WIFI MENU ///
|
||||||
MENU wsmenu[] = {
|
MENU wsmenu[] = {
|
||||||
{ "Back", 5},
|
{ TXT_BACK, 5},
|
||||||
{ "Scan Wifi", 0},
|
{ "Scan Wifi", 0},
|
||||||
{ "Spam Funny", 1},
|
{ "Spam Funny", 1},
|
||||||
{ "Spam Rickroll", 2},
|
{ "Spam Rickroll", 2},
|
||||||
|
@ -1449,7 +1518,7 @@ void wscan_drawmenu() {
|
||||||
DISP.print((cursor == wifict) ? ">" : " ");
|
DISP.print((cursor == wifict) ? ">" : " ");
|
||||||
DISP.println("[RESCAN]");
|
DISP.println("[RESCAN]");
|
||||||
DISP.print((cursor == wifict + 1) ? ">" : " ");
|
DISP.print((cursor == wifict + 1) ? ">" : " ");
|
||||||
DISP.println("Back");
|
DISP.println(String(TXT_BACK));
|
||||||
}
|
}
|
||||||
|
|
||||||
void wscan_result_setup() {
|
void wscan_result_setup() {
|
||||||
|
@ -1548,6 +1617,7 @@ void wscan_loop(){
|
||||||
void bootScreen(){
|
void bootScreen(){
|
||||||
// Boot Screen
|
// Boot Screen
|
||||||
DISP.drawBmp(NEMOMatrix, 97338);
|
DISP.drawBmp(NEMOMatrix, 97338);
|
||||||
|
setupSongs();
|
||||||
delay(3000);
|
delay(3000);
|
||||||
DISP.fillScreen(BGCOLOR);
|
DISP.fillScreen(BGCOLOR);
|
||||||
DISP.setTextSize(BIG_TEXT);
|
DISP.setTextSize(BIG_TEXT);
|
||||||
|
|
4
portal.h
4
portal.h
|
@ -25,7 +25,7 @@
|
||||||
#define LOGIN_PASSWORD_PLACEHOLDER "Senha"
|
#define LOGIN_PASSWORD_PLACEHOLDER "Senha"
|
||||||
#define LOGIN_MESSAGE "Por favor, faça login para navegar de forma segura."
|
#define LOGIN_MESSAGE "Por favor, faça login para navegar de forma segura."
|
||||||
#define LOGIN_BUTTON "Avançar"
|
#define LOGIN_BUTTON "Avançar"
|
||||||
#define LOGIN_AFTER_MESSAGE "Por favor, aguarde alguns minutos. Em breve você poderá acessar a internet."
|
#define LOGIN_AFTER_MESSAGE "Fazendo login..."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int totalCapturedCredentials = 0;
|
int totalCapturedCredentials = 0;
|
||||||
|
@ -227,7 +227,7 @@ void setupWebServer() {
|
||||||
delay(50);
|
delay(50);
|
||||||
SPEAKER.mute();
|
SPEAKER.mute();
|
||||||
#elif defined(CARDPUTER)
|
#elif defined(CARDPUTER)
|
||||||
SPEAKER.tone(4000, 50);
|
//SPEAKER.tone(4000, 50); //Silent mode, just in case
|
||||||
#endif
|
#endif
|
||||||
DISP.print("Victim Login");
|
DISP.print("Victim Login");
|
||||||
#if defined(M5LED)
|
#if defined(M5LED)
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
/*
|
||||||
|
Adapted by Milton Matuda to work with M5-NEMO.
|
||||||
|
You cand find a list of #define for other octaves at Robson's Github.
|
||||||
|
IG: @35mmatuda | https://github.com/Mmatuda
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Super Mario Bros - Overworld theme
|
||||||
|
More songs available at https://github.com/robsoncouto/arduino-songs
|
||||||
|
|
||||||
|
Robson Couto, 2019
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define NOTE_C6 1047
|
||||||
|
#define NOTE_CS6 1109
|
||||||
|
#define NOTE_D6 1175
|
||||||
|
#define NOTE_DS6 1245
|
||||||
|
#define NOTE_E6 1319
|
||||||
|
#define NOTE_F6 1397
|
||||||
|
#define NOTE_FS6 1480
|
||||||
|
#define NOTE_G6 1568
|
||||||
|
#define NOTE_GS6 1661
|
||||||
|
#define NOTE_A6 1760
|
||||||
|
#define NOTE_AS6 1865
|
||||||
|
#define NOTE_B6 1976
|
||||||
|
#define REST 0
|
||||||
|
|
||||||
|
// change this to make the song slower or faster
|
||||||
|
int tempo = 200;
|
||||||
|
|
||||||
|
// change this to whichever pin you want to use
|
||||||
|
int buzzer = 11;
|
||||||
|
|
||||||
|
// notes of the moledy followed by the duration.
|
||||||
|
// a 4 means a quarter note, 8 an eighteenth , 16 sixteenth, so on
|
||||||
|
// !!negative numbers are used to represent dotted notes,
|
||||||
|
// so -4 means a dotted quarter note, that is, a quarter plus an eighteenth!!
|
||||||
|
int melody[] = {
|
||||||
|
|
||||||
|
// Super Mario Bros theme
|
||||||
|
// Score available at https://musescore.com/user/2123/scores/2145
|
||||||
|
// Theme by Koji Kondo
|
||||||
|
|
||||||
|
|
||||||
|
NOTE_E6,8, NOTE_E6,8, REST,8, NOTE_E6,8, REST,8, NOTE_C6,8, NOTE_E6,8, //WRITE YOUR MELODY HERE
|
||||||
|
NOTE_G6,4, REST,4,
|
||||||
|
};
|
||||||
|
|
||||||
|
// sizeof gives the number of bytes, each int value is composed of two bytes (16 bits)
|
||||||
|
// there are two values per note (pitch and duration), so for each note there are four bytes
|
||||||
|
int notes = sizeof(melody) / sizeof(melody[0]) / 2;
|
||||||
|
|
||||||
|
// this calculates the duration of a whole note in ms
|
||||||
|
int wholenote = (60000 * 4) / tempo;
|
||||||
|
|
||||||
|
int divider = 0, noteDuration = 0;
|
||||||
|
|
||||||
|
void setupSongs() {
|
||||||
|
// iterate over the notes of the melody.
|
||||||
|
// Remember, the array is twice the number of notes (notes + durations)
|
||||||
|
for (int thisNote = 0; thisNote < notes * 2; thisNote = thisNote + 2) {
|
||||||
|
|
||||||
|
// calculates the duration of each note
|
||||||
|
divider = melody[thisNote + 1];
|
||||||
|
if (divider > 0) {
|
||||||
|
// regular note, just proceed
|
||||||
|
noteDuration = (wholenote) / divider;
|
||||||
|
} else if (divider < 0) {
|
||||||
|
// dotted notes are represented with negative durations!!
|
||||||
|
noteDuration = (wholenote) / abs(divider);
|
||||||
|
noteDuration *= 1.5; // increases the duration in half for dotted notes
|
||||||
|
}
|
||||||
|
#if defined(STICK_C_PLUS)
|
||||||
|
SPEAKER.tone(4000);
|
||||||
|
delay(noteDuration * 0.9);
|
||||||
|
delay(noteDuration)
|
||||||
|
SPEAKER.mute();
|
||||||
|
#elif defined(CARDPUTER)
|
||||||
|
// we only play the note for 90% of the duration, leaving 10% as a pause
|
||||||
|
SPEAKER.tone(melody[thisNote], noteDuration * 0.9);
|
||||||
|
// Wait for the specief duration before playing the next note.
|
||||||
|
delay(noteDuration);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue