Skip to content

Postman

nandhoman edited this page Apr 25, 2020 · 1 revision

Project

There's made a solution to mock our game we're building for a nanoleaf wall. The grid is made out of 17 rows occasion 6 columns, the project is only plug 'n play useable for that grid. You could use it also for other quadrilateral, but then you might have to change a couple of things in the source code. Our solution is not useable for other shape. Please read below for the copyrigths when you changeing the code.

Reason for this project

For a schoolproject we need to make a couple of games on a wall of nanoleafs. Our project was timed at the start of 2020 till summer 2020, that time the whole world was in crisis due the CoVid-19. So we can't use the real nanoleafs, and this is our solution.

Discussion

  • There's only defined a couple of endpoints that make it possible to build our game. In practice, it should be okay for all projects what don't use effects.
  • Also we don't use the white and the time function, in the colorstring. A other sidenote in the same categorie, is that we don't define types of touches in /lastTouchedTiles. When define all clicks as a single click event, because you can't handle things like swipes, double and triple clicks.

Copyright

Author: Nand Homan, Publish date: 25-4-2020.

The mocking is free to use, when calling the copyright. You are also free to edit the source code but only by calling the copyright in the heading of the source code.

Get /ColorString

Animdata build up

To understand the data of "animData" you have to read the following. You see a couple off numbers, they are static belong they're meaning.

Par example:

102 1 1 200 0 255 0 200 2 1 200 0 255 0 200 3 1 200 0 255 0 200

The first number is static, and should not loop. This number tells you the number off panels. (102) The next seven number tells you something about a specific panel. (1 1 200 0 255 0 200) The first "1" tells you the panel ID. The second "1" tell you that the panel is on. The Third "200" tell you the value of the red color. The fourth "0" tell you the value of the green color. The fifth "255" tell you the value of the blue color. The sixth "0" tell you the value of the white color. The last "200" tells you the time of switching to the next color.

See paragraph 3.2.6.2 of the Offical Open API documentation

Get /lastTouchedTiles

Mostly it speaks for it self. For every touch made on the panels you can get a part of a array. The touch thats made first will show up down below.(FIFO). Gesture is always 0 that means that the panel is tapped once. Read point to of the discussion.

I also refer to the Offical Open API documentation, at paragraph 3.5.2.4.

Post /ColorString

See the /CurrentColorString text. Good to know is that the software the color update every 200ms by default.