Home Creators Posts Import Register Favorites Logout

Content

Hello, lovely Patreons!

You can find the Arduino code (.ino), wiring diagram (.jpg), and Fritzing project (.fzz) for this tutorial at the following Google Drive link: 

https://drive.google.com/open?id=16XIuKJ-mkQVk8ddXU_O6wia3JlefT8PR

Please ask if any questions!

Comments

Kevin Wilhelm

Any tips for connecting all the track wires neatly? I'm relatively novice at soldering and trying to solder 3 contacts on the end of each LED strip has me going crazy. I tried the clamp connectors but they were unreliable. I'd really love to build this puzzle but currently my soldering ability and ability to run the wires tightly are currently holding me back. Any advice would be appreciated!

Martin Ruiz

Hi Alastair. The led strip is 30led/m or 60led/m? Thanks

Greg Pare

Hi There! I get the following : exit status 1 Error compiling for board Arduino/Genuino Uno.

Jennifer

Hi Alastair, I have built a similar Track Puzzle to yours but I am getting some strange results which I believe are down to the fact that my tracks are laid out in a slightly different order to yours, i.e. Track0, Track4, Track3, Track1 and Track2. I am not sure if your sketch can accommodate this and I think the problem is in the "// Only if it's alive!" section of your code as I can't understand what to set the "<" "==" or ">" switches too. Any suggestions would be greatly appreciated, thanks.

Jennifer

Hi Alastair, I will implement your suggestions and see how I get on, as I think this is an amazing game, will keep you posted on the out come and thank you very much for your quick reply.

Jennifer

Hi Alastair, one other thing I have just remembered but I don't know if it is possible, but is it possible to have different scores for the different particles, i.e. for the Particles that have one LED, score 1, for the Particles that have two LED's, score 2, for the Particles that have three LED's, score 3, etc. etc. I am trying to fill up a "Tank" with successful scores, if that makes sense.

Jennifer

Hi Alastair, I have implemented your suggestions, some of which I had figured out, but I am still experiencing very strange effects, with particles jumping tracks at strange positions.

Jennifer

As I said previously, I think the problems lay with the way my Tracks are arranged and perhaps also the way my LED Array is laid out in the sketch. I have tried with your original layout i.e. Track 0 as the Top Line in the Array and Track 4 as the Bottom Line of the array. Then I tried with Track 0 as the Top Line In the array with Track 2 as the bottom line of the array. I have also modified the if() statements also as follows, but not sure I am specifying the Tracks correctly with the > < or == syntax

Jennifer

Sorry keep hitting "Return" on the keyboard which submits the message :-)

Jennifer

// Only if it's alive! if (particlePool[i].alive) { // If the particle is on one of the switch points, change track as appropriate if (particlePool[i].position / 16 == 6) { particlePool[i].track = (digitalRead(switchPins[0])) ? 0 : 1; } // If we took a left at the first junction then we come across the next switch after 9 LEDs if (particlePool[i].position / 16 == 9 && (particlePool[i].track = 0 || particlePool[i].track > 3)) { particlePool[i].track = (digitalRead(switchPins[1])) ? 0 : 4; } // If we took a right at the first junction then we come aross the next switch after 25 LEDs if (particlePool[i].position / 16 == 25 && (particlePool[i].track > 0 || particlePool[i].track < 3)) { particlePool[i].track = (digitalRead(switchPins[2])) ? 1 : 2; } // If we went left, then right, there's a final junction after 14 LEDs if (particlePool[i].position / 16 == 14 && (particlePool[i].track > 2 || particlePool[i].track <= 4)) { particlePool[i].track = (digitalRead(switchPins[3])) ? 3 : 4; }

Jennifer

I can send you a copy of my Sketch which has all the Tracks Laid Out and Switch Positions / Led Numbers if it helps ? What is the best way to send it to you ??

Jennifer

const unsigned int ledTrack[numParticleTypes][MAX_NUM_LEDS_PER_TRACK] = { // LHS //Track 0 {0, 1, 2, 3, 4, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, //Track 4 {0, 1, 2, 3, 4, 76, 77, 78, 79, 80, 94, 95, 96, 97, 98, 104, 105, 106, 107, 108, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 72, 73, 74, 75, -1, -1, -1, -1, -1, -1, -1, -1, -1}, //Track 3 {0, 1, 2, 3, 4, 76, 77, 78, 79, 80, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 49, 50, 51, 52, 63, 64, 65, 66, 67, 68, 69, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, //Track 1 {0, 1, 2, 3, 4, 76, 77, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 , 17, 18, 19, 20, 21, 22, 23, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, -1, -1, -1, -1, -1, -1}, //Track 2 {0, 1, 2, 3, 4, 76, 77, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 , 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, -1, -1} // RHS };

Jennifer

Distance Travelled 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] (Track 2) / [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] (Switch 3) / \ / [39] [40] [41] [42] [43] [44] [46] [45] [47] [48] (Track 1) / / [99] [100] [101][102][103] [49] [50] [51] [52] [63] [64] [65] [66] [67] [68] [69] [70] (Track 3) [0] [1] [2] [3] [4] [76] [77] (Switch 0) / \ [94] [95] [96] [97] [98](Switch 2) \ / \ [78] [79] [80](Switch 1) [104] [105] [106][107] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [71] [72] [73] [74] [75] (Track 4) \ [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] (Track 0)

Jennifer

Don't think my Track Layout has pasted correctly in Patreon....????

Alastair Aitchison

Patreon has a habit of chewing up messages! Can you email it to me? alastair@playful.technology

Alastair Aitchison

Also, it would really help if you could just draw out (pencil and paper then take a photo is fine) how your LED strips are arranged, and the number of LEDs in each strip just so I can double check the values you're using in the code.

Jennifer

Alastair, thanks I will get everything drawn up correctly on paper and send you it as soon as I can and can e-mail a copy of the code to you as well.

Jennifer

Hi Alastair, I have just sent you an email with a hand annotated picture of my Track Layout with the LED's numbered, which hopefully you can read O.K. I have also attached my Arduino Sketch which at the top shows the Layout of the Tracks as per your original Sketch and a Video of what the Puzzle is currently doing. Many thanks in advance for looking at this for me as it is a great Puzzle and would love to get it sorted. Please let me know if you need any more information. Regards, Jennifer.

Timothy Riseborough

Hi Alastair, I hope you are well! I have built this puzzle on a Wemos D1 Mini, I've built it so it has 4 switches (so 5 tracks), but for some reason, I can only get 3 out of 4 switches working... my wiring is ok, because if I fiddle with the code, I can change which switch doesn't work! Don't suppose this is a problem that you are aware of a possible solution to? Thanks, Tim

Bill Clark

I have built this puzzle and am using a Arduino Mega and the same WS2812B lights. I made it with 134 lights, but the same 5 tracks just lengthened. I added the second power point after 71 lights instead of 63 lights like the original. I have made what I think were the necessary changes to the code. When I try to run it nothing happens. I have also tried running it with the original code, but again nothing happens. Random lights will come on and stay on. It is quite frustrating. Has anyone experienced this? I am wondering if I might need to get the same version of Fast LED that was originally used, but can't find it anywhere.

Timothy Riseborough

Hi Alastair, Sorry, I need your help again!! Ive had some time away from this puzzle whilst working on other things! I've come back to it and now when running the code, can only get the first LED to flash (I guess when spawning). Other than that, nothing else seems to work. I am using a wemos D1 mini, and have proved its not the LEDs (by using the fire example in the arduino.ino, and also by adding a flashing light in the setup that lights all of the leds in turn before continuing the setup - these all work fine! Ive also tried disconnecting the 'switches' from the board incase it was a start up issue. Do you have any ideas as to why this puzzle wont work?

chris cole

Hi Alastair, I wanted to know if you've made any code edits to "reset" the puzzle maybe 5-10 seconds after On Solve, and to activate a mag-lock On Solve? I got the track working right out of the box no issue (I'm much better at reverse engineering than programming)