-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create basic and basic-osc templates. Update readme
- Loading branch information
1 parent
7656092
commit 2cc23f6
Showing
87 changed files
with
7,003 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.pio | ||
.vscode/.browse.c_cpp.db* | ||
.vscode/c_cpp_properties.json | ||
.vscode/launch.json | ||
.vscode/ipch |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; https://docs.platformio.org/page/projectconf.html | ||
|
||
[platformio] | ||
description = Puara module manager | ||
|
||
[common] | ||
lib_deps = | ||
https://github.com/Puara/puara-module.git#0.3 | ||
https://github.com/cnmat/OSC#3.5.8 | ||
|
||
[env:Xiao] | ||
platform = espressif32 | ||
board = seeed_xiao_esp32c3 | ||
framework = arduino | ||
board_build.partitions = min_spiffs_no_OTA.csv | ||
lib_deps = | ||
${common.lib_deps} | ||
monitor_speed = 115200 | ||
monitor_echo = yes | ||
monitor_filters = | ||
default | ||
esp32_exception_decoder | ||
|
||
[env:tinypico] | ||
platform = espressif32 | ||
board = tinypico | ||
framework = arduino | ||
board_build.partitions = min_spiffs_no_OTA.csv | ||
build_flags = | ||
-DBOARD_HAS_PSRAM | ||
-mfix-esp32-psram-cache-issue | ||
lib_deps = | ||
${common.lib_deps} | ||
monitor_speed = 115200 | ||
monitor_echo = yes | ||
monitor_filters = | ||
default | ||
esp32_exception_decoder | ||
|
||
[env:m5stick-c] | ||
platform = espressif32 | ||
board = m5stick-c | ||
framework = arduino | ||
board_build.partitions = min_spiffs_no_OTA.csv | ||
build_flags = | ||
-DBOARD_HAS_PSRAM | ||
-mfix-esp32-psram-cache-issue | ||
lib_deps = | ||
${common.lib_deps} | ||
monitor_speed = 115200 | ||
monitor_echo = yes | ||
monitor_filters = | ||
default | ||
esp32_exception_decoder | ||
|
||
[env:ESP32-S3] | ||
platform = espressif32 | ||
board = esp32-c3-devkitc-02 | ||
framework = arduino | ||
board_build.partitions = min_spiffs_no_OTA.csv | ||
build_flags = | ||
-DBOARD_HAS_PSRAM | ||
-mfix-esp32-psram-cache-issue | ||
lib_deps = | ||
${common.lib_deps} | ||
monitor_speed = 115200 | ||
monitor_echo = yes | ||
monitor_filters = | ||
default | ||
esp32_exception_decoder |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
//****************************************************************************// | ||
// Puara Module Manager // | ||
// Société des Arts Technologiques (SAT) // | ||
// Input Devices and Music Interaction Laboratory (IDMIL), McGill University // | ||
//****************************************************************************// | ||
|
||
#include "Arduino.h" | ||
|
||
// Include Puara's module manager | ||
// If using Arduino.h, include it before including puara.h | ||
#include "puara.h" | ||
|
||
// Initialize Puara's module manager | ||
Puara puara; | ||
|
||
/* | ||
* Include CNMAT's OSC library (by Adrian Freed) | ||
* This library was chosen as it is widely used, but it can be replaced by any | ||
* other OSC library of choice | ||
*/ | ||
#include <WiFiUdp.h> | ||
#include <OSCMessage.h> | ||
|
||
// UDP instances to let us send and receive packets | ||
WiFiUDP Udp; | ||
|
||
// Dummy sensor data | ||
float sensor; | ||
|
||
void setup() { | ||
#ifdef Arduino_h | ||
Serial.begin(115200); | ||
#endif | ||
|
||
/* | ||
* the Puara start function initializes the spiffs, reads config and custom json | ||
* settings, start the wi-fi AP/connects to SSID, starts the webserver, serial | ||
* listening, MDNS service, and scans for WiFi networks. | ||
*/ | ||
puara.start(); | ||
|
||
/* | ||
* Printing custom settings stored. The data/config.json values will print during | ||
* Initialization (puara.start) | ||
*/ | ||
std::cout << "\n" | ||
<< "Settings stored in data/settings.json:\n" | ||
<< "Hitchhiker: " << puara.getVarText ("Hitchhiker") << "\n" | ||
<< "answer_to_everything: " << puara.getVarNumber("answer_to_everything") << "\n" | ||
<< "variable3: " << puara.getVarNumber("variable3") << "\n" | ||
<< std::endl; | ||
|
||
// Start the UDP instances | ||
Udp.begin(puara.getLocalPORT()); | ||
} | ||
|
||
void loop() { | ||
|
||
// Update the dummy sensor variable with random number | ||
sensor = static_cast <float> (rand()) / (static_cast <float> (RAND_MAX/10)); | ||
|
||
// print the dummy sensor data | ||
std::cout << "\n" | ||
<< "Settings stored in data/settings.json:\n" | ||
<< "Dummy sensor value: " << sensor << "\n" | ||
<< std::endl; | ||
|
||
/* | ||
* Sending OSC messages. | ||
* If you're not planning to send messages to both addresses (OSC1 and OSC2), | ||
* it is recommended to set the address to 0.0.0.0 to avoid cluttering the | ||
* network (WiFiUdp will print an warning message in those cases). | ||
*/ | ||
if (puara.IP1_ready()) { // set namespace and send OSC message for address 1 | ||
OSCMessage msg1(("/" + puara.get_dmi_name()).c_str()); | ||
msg1.add(sensor); | ||
Udp.beginPacket(puara.getIP1().c_str(), puara.getPORT1()); | ||
msg1.send(Udp); | ||
Udp.endPacket(); | ||
msg1.empty(); | ||
std::cout << "Message send to " << puara.getIP1() << std::endl; | ||
} | ||
if (puara.IP2_ready()) { // set namespace and send OSC message for address 2 | ||
OSCMessage msg2(("/" + puara.get_dmi_name()).c_str()); | ||
msg2.add(sensor); | ||
Udp.beginPacket(puara.getIP2().c_str(), puara.getPORT2()); | ||
msg2.send(Udp); | ||
Udp.endPacket(); | ||
msg2.empty(); | ||
std::cout << "Message send to " << puara.getIP2() << std::endl; | ||
} | ||
|
||
// run at 1 Hz (1 message per second) | ||
vTaskDelay(1000 / portTICK_PERIOD_MS); | ||
} | ||
|
||
/* | ||
* The Arduino header defines app_main and conflicts with having an app_main function | ||
* in code. This ifndef makes the code valid in case we remove the Arduino header in | ||
* the future. | ||
*/ | ||
#ifndef Arduino_h | ||
extern "C" { | ||
void app_main(void); | ||
} | ||
|
||
void app_main() { | ||
setup(); | ||
while(1) { | ||
loop(); | ||
} | ||
} | ||
#endif |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.pio | ||
.vscode/.browse.c_cpp.db* | ||
.vscode/c_cpp_properties.json | ||
.vscode/launch.json | ||
.vscode/ipch |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; https://docs.platformio.org/page/projectconf.html | ||
|
||
[platformio] | ||
description = Puara module manager | ||
|
||
[common] | ||
lib_deps = | ||
https://github.com/Puara/puara-module.git#0.3 | ||
;build_flags = | ||
; -DCONFIG_ARDUINO_LOOP_STACK_SIZE=32768 | ||
|
||
[env:Xiao] | ||
platform = espressif32 | ||
board = seeed_xiao_esp32c3 | ||
framework = arduino | ||
board_build.partitions = min_spiffs_no_OTA.csv | ||
;build_flags = ${common.build_flags} | ||
lib_deps = ${common.lib_deps} | ||
monitor_speed = 115200 | ||
monitor_echo = yes | ||
monitor_filters = | ||
default | ||
esp32_exception_decoder | ||
|
||
[env:tinypico] | ||
platform = espressif32 | ||
board = tinypico | ||
framework = arduino | ||
board_build.partitions = min_spiffs_no_OTA.csv | ||
build_flags = | ||
-DBOARD_HAS_PSRAM | ||
-mfix-esp32-psram-cache-issue | ||
;${common.build_flags} | ||
lib_deps = ${common.lib_deps} | ||
monitor_speed = 115200 | ||
monitor_echo = yes | ||
monitor_filters = | ||
default | ||
esp32_exception_decoder | ||
|
||
[env:m5stick-c] | ||
platform = espressif32 | ||
board = m5stick-c | ||
framework = arduino | ||
board_build.partitions = min_spiffs_no_OTA.csv | ||
build_flags = | ||
-DBOARD_HAS_PSRAM | ||
-mfix-esp32-psram-cache-issue | ||
;build_flags = ${common.build_flags} | ||
lib_deps = ${common.lib_deps} | ||
monitor_speed = 115200 | ||
monitor_echo = yes | ||
monitor_filters = | ||
default | ||
esp32_exception_decoder | ||
|
||
[env:ESP32-S3] | ||
platform = espressif32 | ||
board = esp32-c3-devkitc-02 | ||
framework = arduino | ||
board_build.partitions = min_spiffs_no_OTA.csv | ||
build_flags = | ||
-DBOARD_HAS_PSRAM | ||
-mfix-esp32-psram-cache-issue | ||
;build_flags = ${common.build_flags} | ||
lib_deps = ${common.lib_deps} | ||
monitor_speed = 115200 | ||
monitor_echo = yes | ||
monitor_filters = | ||
default | ||
esp32_exception_decoder |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.