Place the Ripple in a node
| 50 | |
| 51 | // Place the Ripple in a node |
| 52 | void start(byte n, byte d, unsigned long c, float s, unsigned long l, byte b) { |
| 53 | color = c; |
| 54 | speed = s; |
| 55 | lifespan = l; |
| 56 | behavior = b; |
| 57 | |
| 58 | birthday = millis(); |
| 59 | pressure = 0; |
| 60 | state = withinNode; |
| 61 | |
| 62 | position[0] = n; |
| 63 | position[1] = d; |
| 64 | |
| 65 | justStarted = true; |
| 66 | |
| 67 | Serial.print("Ripple "); |
| 68 | Serial.print(rippleId); |
| 69 | Serial.print(" starting at node "); |
| 70 | Serial.print(position[0]); |
| 71 | Serial.print(" direction "); |
| 72 | Serial.println(position[1]); |
| 73 | } |
| 74 | |
| 75 | void advance(byte ledColors[40][14][3]) { |
| 76 | unsigned long age = millis() - birthday; |