Skip to content

A client-server serial bus for Arduino keyboard to run scripts and activate LEDs according to them

License

Notifications You must be signed in to change notification settings

MRsagi/ledboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


gif

Table of Contents
  1. About The Project
  2. Getting Started
  3. Configuration
  4. Usage
  5. Contributing
  6. License
  7. Acknowledgements

About The Project

A client-server serial bus for Arduino keyboard to run scripts and activate LEDs according to them. There are a lot of Arduino keyboards instructions and manuals out there. I focused on 2 things:

  1. The option of running script and not just keystrokes or macros
  2. Feedback that also turning on and off the LEDs according to whatever you config

Built With

This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

Getting Started

Prerequisites

  • Of course you need to prepare your Arduino keyboard yourself. There are plenty of tutorials on the internet of how to connect LEDs and buttons to it. make sure you mark the port of each LED and button.
    Note that currently the code support buttons connected to analog pins.
  • You must have to install Arduino IDE or similar in order to burn the .ino file to the Arduino.
  • Go 16 is required to build the project, earlier versions should work too.

Installation

Arduino

  1. Make sure you does these changes in the .ino file before uploading:
    1. change analog_pins array and num_buttons
    2. change btn_leds array and num_leds to your corresponding used pins
    3. change the size of block array to the number of buttons
    4. change the size of timers array to the number of leds
  2. compile and upload

Go script

go mod vendor
#if you want to pre-compile:
go build .

Configurations

conf.json fields: *after each there are examples

{
    "ledBoard": {
        "port": "<your PC port usually COM* in windows and /dev/ttyUSB* or /dev/ttyACM*>",
        "baud": 115200
    },
    "buttons": {
        "<.ino button array index +1>": {"cmd": "<command>"},
        "2": {"cmd": "cscript //nologo C:\\Users\\mrsag\\git\\ledboard\\scripts\\toggle_zoom_audio.js"},
    },
    "leds": {
      "<.ino led array index +1>": {
        "type" : "<activate rule type: toggle/cmd[/none]>",
        "toggle": {
          "button": "<button number>",
          "init": "<true/false>"
        },
        "ledCmd": {
          "cmd": "<command>",
          "sec": "<interval in seconds [default: 5]>",
          "blink": "<set true to blink and not just on [default: false]>"
        }
      },
      "3": {
          "type" : "toggle",
          "toggle": {
              "init": false,
              "button": 4
          }
      },
      "4": {
          "type": "cmd",
          "ledCmd": {
              "cmd": "C:\\Users\\mrsag\\git\\ledboard\\scripts\\check_zoom.bat",
              "sec": 5,
              "blink": true
          }
      }
    }

Usage

conf.json is example configuration file for 8 button and leds and it has all of the example uses. some scripts example can be found in the script folder

  1. edit conf.json with the Arduino port in your computer, the button numbers (from your array, starting at 1), and the cmd and led lighting configuration.
  2. connect the keyboard.
  3. make sure the config file is in the same folder as the script (or use --conf=) and run it:
go run .
# or if you pre-compiled on windows:
./ledboard.exe
#on linux:
./ledboard

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

About

A client-server serial bus for Arduino keyboard to run scripts and activate LEDs according to them

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published