Skip to content

hana/esp8266-OSC_module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

esp8266-OSC_module

License: CC BY-NC-SA 4.0  

Overview

Controll all GPIO inputs/outputs through OSC.

Description

This code enables you to controll all GPIO through OSC. For example, you can blink LED with Max/MSP. You also can use this Max Patch ( https://github.com/fataris/ESP8266-OSC_Basic_Controller ) to control the module.

Requirement

  • Metro (Arduino Playground)

Usage

Each message requires MODULE_ID to identify the target module.

1. Setup

Set your WiFi's SSID and passphrase

char ssid[] = "SSID";          // your network SSID (name)  
char pass[] = "PASS";                    // your network password

Set host Address and port

IPAddress hostAddress(224, 0, 0, 1);     // remote IP of your computer
const unsigned int hostPort = 56789;          // remote port to receive OSC

Set incoming port

const unsigned int receivePort = 54321;        // local port to listen to OSC packets

2. Sending OSC message to ESP

/gpio_mode "(int)MODULE_ID" "(int)GPIO_ID" "(bool)IN/OUT"
  • This messages changes pinMode()

  • 0 = Input, 1 = Output.

  • GPIO_IDs :: 12, 13, 14

    /digital_out "(int)MODULE_ID" "(int)GPIO_ID" "(float)val"

  • This message sets value of DigitaiWrite()

  • val : 0.0 ~ 1.0, which will be 0.0V ~ 3.3V

3. Receiving OSC message from ESP

/analog_in "(int)MODULE_ID" "(float)val"
  • Analog input value comes with this message

  • Value range : 0.0 ~ 1.0

    /digital_in "(int)MODULE_ID" "(int)val"

  • Digital input value comes with this message

  • Value : 0, 1

    /active "(int)MODULE_ID" 1

  • This message comes every second to notice the module is acitve.

LICENSE

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published