Code Monkey home page Code Monkey logo

d3vice-controlpoint-xbee's People

Contributors

insanity54 avatar

Watchers

 avatar  avatar

d3vice-controlpoint-xbee's Issues

Compatibility with gateway

The controlpoint should be able to do the following--

  • Announce itself to the network
  • Resume gameplay gracefully after unexpected reboot
  • Sync state with feathers server

Russell Seal of Approval

D3vice hardware needs Russell's seal of approval. (seek negative feedback, fix issue, repeat until no negative feedback remains)

Brandon Seal of Approval

D3vice hardware needs Brandon seal of approval. (seek negative feedback, fix issue, repeat until no negative feedback remains)

LightStrip::show() should be more user friendly

I don't know a good solution yet, but LightStrip::show() is not very good at displaying values above the maximum number of neopixels. Perhaps when displaying values above the max number of neopixels, it could switch to a binary display?

As it is right now with 16 neopixels, once the number to be displayed goes beyond 15, the neopixel display just goes blank, until the user increments the config to 255. Once 255 is reached, one more increment wraps around to 0, at which point the first neopixel is displayed. Binary seems nice for developers, but then again it's not nice to stare into neopixels and calculate what the displayed value actually is. Also most end users probably can't read binary.

Best UX is through the GUI of course, but there has to be a better way to communicate to the user what value they have chosen. Maybe a generic progress bar that means max is 255? That seems error prone. Binary still seems best.

Power supply is not secure

The power supply flops around given slack in the power wiring. The main board does not stay put with Velcro. A better solution for mounting the modules to the inside of the box is preferred.

Parser wanted

The controlpoint receives HEX encoded data generated by the gateway--

            xbee.remoteTransmit({
                destinationId: device.did,
                broadcast: false,
                data: `DCXST
                       CT${device.controllingTeam.toString(16)}
                       RP${device.redProgress.toString(16)}
                       BP${device.bluProgress.toString(16)}` // Tell DCX to act GAME 0
            })

This is nasty code that currently "parses" the received data

      if (
        rx.getData(0) == 'D' &&
        rx.getData(1) == 'C' &&
        rx.getData(2) == 'X' &&
        rx.getData(3) == 'S' &&
        rx.getData(4) == 'T' 
      )
      {
        // we're getting a state update (ST)
        
        if (rx.getData(5) == 'C' &&
            rx.getData(6) == 'T'
        )
        {
          // Controlling Team
          if (rx.getData(7) < 5) {
            controllingTeam = rx.getData(7);
          }
        }

        if (rx.getData(8) == 'R' &&
            rx.getData(9) == 'P'
        )
        {
          if (rx.getData(10) < 101) {
            redProgress = rx.getData(10);
          }
        }

        if (rx.getData(11) == 'B' &&
            rx.getData(12) == 'P'
        )
        {
          if (rx.getData(13) < 101) {
            bluProgress = rx.getData(11);
          }
        }
      }

You can see it is not flexible. For example, BP must always come after RP.

This is ideal code, but I'm unsure of how to implement a parser class.

    DCXParser dcxParser = DCXParser(rx);

      // interpret the state updates
     if (dcxParser.getDataType() == STATE_UPDATE) {
       controllingTeam = dcxParser.getData(CONTROLLING_TEAM);
       redProgress = dcxParser.getData(RED_PROGRESS);
       bluProgress = dcxParser.getData(BLU_PROGRESS);
     }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.