$ 1 32 2.2675736961451248E-05 0 5 50 Auto 2112 2112 true 242 352 256 352 320 0 %2F%2F%20Five%20ternary%20acceleration%20digits%3A%20X%2C%20Y%2C%20pitch%2C%20yaw%20and%20depth.%0A%2F%2F%20The%208-bit%20command%20is%20held%20on%20D2-D9.%20D10%20clocks%20the%2016%20ms%20motion%20step.%0Aunsigned%20long%20frameAt%20%3D%200%3B%0Aunsigned%20long%20highAt%20%3D%200%3B%0Aint%20phase%20%3D%200%3B%0Abool%20heartbeat%20%3D%20true%3B%0Aint%20lastCommand%20%3D%200%3B%0Aint%20tickIndex%20%3D%200%3B%0Aint%20spinRate%5B2%5D%20%3D%20%7B64%2C%20116%7D%3B%0Aint%20spinAccel%5B2%5D%3B%0Aint%20spinDemand%5B2%5D%3B%0Aint%20depthPosition%20%3D%200%3B%0Aint%20depthVelocity%20%3D%200%3B%0Aint%20depthForce%20%3D%200%3B%0Aint%20depthDemand%20%3D%200%3B%0Abool%20movingAway%20%3D%20true%3B%0Aint%20approach%28int%20current%2C%20int%20target%29%20%7B%0A%20%20if%20%28current%20%3C%20target%29%20return%20current%20%2B%201%3B%0A%20%20if%20%28current%20%3E%20target%29%20return%20current%20-%201%3B%0A%20%20return%20current%3B%0A%7D%0A%0Aint%20limited%28int%20value%2C%20int%20lo%2C%20int%20hi%29%20%7B%0A%20%20if%20%28value%20%3C%20lo%29%20return%20lo%3B%0A%20%20if%20%28value%20%3E%20hi%29%20return%20hi%3B%0A%20%20return%20value%3B%0A%7D%0A%0Aint%20digitForRate%28int%20current%2C%20int%20target%29%20%7B%0A%20%20if%20%28current%20%3C%20target%20-%206%29%20return%201%3B%0A%20%20if%20%28current%20%3E%20target%20%2B%206%29%20return%202%3B%0A%20%20return%200%3B%0A%7D%0A%0Aint%20accelerationFor%28int%20digit%29%20%7B%0A%20%20if%20%28digit%20%3D%3D%201%29%20return%204%3B%0A%20%20if%20%28digit%20%3D%3D%202%29%20return%20-4%3B%0A%20%20return%200%3B%0A%7D%0A%0Aint%20depthDigit%28%29%20%7B%0A%20%20if%20%28movingAway%20%26%26%20depthPosition%20%3E%3D%209000%29%20movingAway%20%3D%20false%3B%0A%20%20else%20if%20%28%21movingAway%20%26%26%20depthPosition%20%3C%3D%20480%29%20movingAway%20%3D%20true%3B%0A%20%20int%20remaining%20%3D%20movingAway%20%3F%209000%20-%20depthPosition%20%3A%20depthPosition%20-%20480%3B%0A%20%20int%20rate%20%3D%2064%3B%0A%20%20if%20%28remaining%20%3C%201200%29%20rate%20%3D%2036%3B%0A%20%20if%20%28remaining%20%3C%20450%29%20rate%20%3D%2016%3B%0A%20%20if%20%28%21movingAway%29%20rate%20%3D%20-rate%3B%0A%20%20return%20digitForRate%28depthVelocity%2C%20rate%29%3B%0A%7D%0A%0Aint%20planCommand%28%29%20%7B%0A%20%20int%20period%20%3D%20tickIndex%20%2F%2032%3B%0A%20%20int%20x%20%3D%200%3B%0A%20%20int%20y%20%3D%200%3B%0A%20%20if%20%28period%20%3D%3D%200%20%7C%7C%20period%20%3D%3D%205%29%20x%20%3D%201%3B%0A%20%20if%20%28period%20%3D%3D%202%20%7C%7C%20period%20%3D%3D%207%29%20x%20%3D%202%3B%0A%20%20if%20%28period%20%3D%3D%201%20%7C%7C%20period%20%3D%3D%206%29%20y%20%3D%201%3B%0A%20%20if%20%28period%20%3D%3D%203%20%7C%7C%20period%20%3D%3D%204%29%20y%20%3D%202%3B%0A%20%20int%20pitchTarget%20%3D%2052%3B%0A%20%20if%20%28%28period%20%26%201%29%20%21%3D%200%29%20pitchTarget%20%3D%2092%3B%0A%20%20int%20yawTarget%20%3D%2078%3B%0A%20%20if%20%28%28period%20%26%202%29%20%21%3D%200%29%20yawTarget%20%3D%20142%3B%0A%20%20int%20pitch%20%3D%20digitForRate%28spinRate%5B0%5D%2C%20pitchTarget%29%3B%0A%20%20int%20yaw%20%3D%20digitForRate%28spinRate%5B1%5D%2C%20yawTarget%29%3B%0A%20%20spinDemand%5B0%5D%20%3D%20accelerationFor%28pitch%29%3B%0A%20%20spinDemand%5B1%5D%20%3D%20accelerationFor%28yaw%29%3B%0A%20%20int%20depth%20%3D%20depthDigit%28%29%3B%0A%20%20depthDemand%20%3D%20accelerationFor%28depth%29%3B%0A%20%20return%20x%20%2B%203%20%2A%20y%20%2B%209%20%2A%20pitch%20%2B%2027%20%2A%20yaw%20%2B%2081%20%2A%20depth%3B%0A%7D%0A%0Avoid%20sendCommand%28int%20cmd%29%20%7B%0A%20%20int%20changed%20%3D%20cmd%20%5E%20lastCommand%3B%0A%20%20int%20value%20%3D%20cmd%3B%0A%20%20for%20%28int%20bit%20%3D%200%3B%20bit%20%3C%208%20%26%26%20changed%20%21%3D%200%3B%20bit%2B%2B%29%20%7B%0A%20%20%20%20if%20%28%28changed%20%26%201%29%20%21%3D%200%29%20digitalWrite%282%20%2B%20bit%2C%20value%20%26%201%29%3B%0A%20%20%20%20changed%20%3D%20changed%20%3E%3E%201%3B%0A%20%20%20%20value%20%3D%20value%20%3E%3E%201%3B%0A%20%20%7D%0A%20%20lastCommand%20%3D%20cmd%3B%0A%7D%0A%0Avoid%20advanceRateModel%28%29%20%7B%0A%20%20for%20%28int%20i%20%3D%200%3B%20i%20%3C%202%3B%20i%2B%2B%29%20spinAccel%5Bi%5D%20%3D%20approach%28spinAccel%5Bi%5D%2C%20spinDemand%5Bi%5D%29%3B%0A%20%20spinRate%5B0%5D%20%3D%20limited%28spinRate%5B0%5D%20%2B%20spinAccel%5B0%5D%2C%2040%2C%20100%29%3B%0A%20%20spinRate%5B1%5D%20%3D%20limited%28spinRate%5B1%5D%20%2B%20spinAccel%5B1%5D%2C%2060%2C%20156%29%3B%0A%20%20depthForce%20%3D%20approach%28depthForce%2C%20depthDemand%29%3B%0A%20%20int%20oldDepthSpeed%20%3D%20depthVelocity%3B%0A%20%20depthVelocity%20%3D%20limited%28oldDepthSpeed%20%2B%20depthForce%2C%20-72%2C%2072%29%3B%0A%20%20depthPosition%20%3D%20depthPosition%20%2B%20%28oldDepthSpeed%20%2B%20depthVelocity%29%20%2F%202%3B%0A%20%20if%20%28depthPosition%20%3C%200%29%20%7B%0A%20%20%20%20depthPosition%20%3D%200%3B%0A%20%20%20%20depthVelocity%20%3D%200%3B%0A%20%20%7D%20else%20if%20%28depthPosition%20%3E%209600%29%20%7B%0A%20%20%20%20depthPosition%20%3D%209600%3B%0A%20%20%20%20depthVelocity%20%3D%200%3B%0A%20%20%7D%0A%20%20tickIndex%20%3D%20%28tickIndex%20%2B%201%29%20%26%20255%3B%0A%7D%0A%0Avoid%20setup%28%29%20%7B%0A%20%20for%20%28int%20pin%20%3D%202%3B%20pin%20%3C%3D%2010%3B%20pin%2B%2B%29%20%7B%0A%20%20%20%20pinMode%28pin%2C%20OUTPUT%29%3B%0A%20%20%20%20digitalWrite%28pin%2C%20LOW%29%3B%0A%20%20%7D%0A%20%20pinMode%2811%2C%20INPUT%29%3B%0A%20%20pinMode%2813%2C%20OUTPUT%29%3B%0A%20%20digitalWrite%2813%2C%20HIGH%29%3B%0A%7D%0A%0Avoid%20loop%28%29%20%7B%0A%20%20unsigned%20long%20now%20%3D%20millis%28%29%3B%0A%20%20bool%20beat%20%3D%20now%20%25%201500UL%20%3C%201000UL%3B%0A%20%20if%20%28beat%20%21%3D%20heartbeat%29%20%7B%0A%20%20%20%20heartbeat%20%3D%20beat%3B%0A%20%20%20%20digitalWrite%2813%2C%20beat%20%3F%20HIGH%20%3A%20LOW%29%3B%0A%20%20%7D%0A%20%20bool%20ack%20%3D%20digitalRead%2811%29%20%21%3D%200%3B%0A%20%20if%20%28phase%20%3D%3D%200%20%26%26%20%21ack%20%26%26%20now%20-%20frameAt%20%3E%3D%2016UL%29%20%7B%0A%20%20%20%20frameAt%20%3D%20now%3B%0A%20%20%20%20if%20%28%28tickIndex%20%26%207%29%20%3D%3D%200%29%20%7B%0A%20%20%20%20%20%20int%20cmd%20%3D%20planCommand%28%29%3B%0A%20%20%20%20%20%20if%20%28cmd%20%21%3D%20lastCommand%29%20%7B%0A%20%20%20%20%20%20%20%20sendCommand%28cmd%29%3B%0A%20%20%20%20%20%20%20%20phase%20%3D%201%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20digitalWrite%2810%2C%20HIGH%29%3B%0A%20%20%20%20highAt%20%3D%20now%3B%0A%20%20%20%20phase%20%3D%202%3B%0A%20%20%7D%20else%20if%20%28phase%20%3D%3D%201%20%26%26%20now%20-%20frameAt%20%3E%3D%202UL%29%20%7B%0A%20%20%20%20digitalWrite%2810%2C%20HIGH%29%3B%0A%20%20%20%20highAt%20%3D%20now%3B%0A%20%20%20%20phase%20%3D%202%3B%0A%20%20%7D%20else%20if%20%28phase%20%3D%3D%202%20%26%26%20%28ack%20%7C%7C%20now%20-%20highAt%20%3E%3D%2032UL%29%29%20%7B%0A%20%20%20%20if%20%28ack%29%20advanceRateModel%28%29%3B%0A%20%20%20%20digitalWrite%2810%2C%20LOW%29%3B%0A%20%20%20%20phase%20%3D%200%3B%0A%20%20%7D%0A%7D%0A 315 576 384 576 448 4096 %2F%2F%20Live%20second-order%20cube.%20Center%20uses%20256%20units%20per%20grid%20pixel.%0Aint%20controlPins%5B8%5D%20%3D%20%7B10%2C9%2C8%2C7%2C6%2C5%2C4%2C3%7D%3B%0Aint%20demand%5B5%5D%3B%0Aint%20force%5B5%5D%3B%0Aint%20lastCommand%20%3D%200%3B%0Aint%20depthPosition%20%3D%200%3B%0Aint%20depthVelocity%20%3D%200%3B%0Aint%20faceCutoff%20%3D%2012%3B%0Aint%20quarterSine%5B65%5D%20%3D%20%7B0%2C%203%2C%206%2C%209%2C%2013%2C%2016%2C%2019%2C%2022%2C%2025%2C%2028%2C%2031%2C%2034%2C%2037%2C%2040%2C%2043%2C%2046%2C%2049%2C%2052%2C%2055%2C%2058%2C%2060%2C%2063%2C%2066%2C%2068%2C%2071%2C%2074%2C%2076%2C%2079%2C%2081%2C%2084%2C%2086%2C%2088%2C%2091%2C%2093%2C%2095%2C%2097%2C%2099%2C%20101%2C%20103%2C%20105%2C%20106%2C%20108%2C%20110%2C%20111%2C%20113%2C%20114%2C%20116%2C%20117%2C%20118%2C%20119%2C%20121%2C%20122%2C%20122%2C%20123%2C%20124%2C%20125%2C%20126%2C%20126%2C%20127%2C%20127%2C%20127%2C%20128%2C%20128%2C%20128%2C%20128%7D%3B%0Aint%20edgeStart%5B12%5D%20%3D%20%7B0%2C2%2C4%2C6%2C0%2C1%2C4%2C5%2C0%2C1%2C2%2C3%7D%3B%0Aint%20edgeEnd%5B12%5D%20%3D%20%7B1%2C3%2C5%2C7%2C2%2C3%2C6%2C7%2C4%2C5%2C6%2C7%7D%3B%0Aint%20px%5B8%5D%3B%0Aint%20py%5B8%5D%3B%0A%2F%2F%20Angular%20phases%20use%2064%20units%20per%20sine-table%20step.%0Aint%20pitchPhase%20%3D%202368%3B%0Aint%20yawPhase%20%3D%203392%3B%0Aint%20spinRate%5B2%5D%20%3D%20%7B64%2C%20116%7D%3B%0Aint%20centerX%20%3D%2012544%3B%0Aint%20centerY%20%3D%2013824%3B%0Aint%20velocityX%20%3D%20128%3B%0Aint%20velocityY%20%3D%2096%3B%0Aint%20visible%20%3D%200%3B%0Abool%20ackHigh%20%3D%20false%3B%0Abool%20tickPending%20%3D%20false%3B%0A%0Aint%20sine128%28int%20turn%29%20%7B%0A%20%20turn%20%3D%20turn%20%26%20255%3B%0A%20%20if%20%28turn%20%3C%3D%2064%29%20return%20quarterSine%5Bturn%5D%3B%0A%20%20if%20%28turn%20%3C%3D%20128%29%20return%20quarterSine%5B128%20-%20turn%5D%3B%0A%20%20if%20%28turn%20%3C%3D%20192%29%20return%20-quarterSine%5Bturn%20-%20128%5D%3B%0A%20%20return%20-quarterSine%5B256%20-%20turn%5D%3B%0A%7D%0A%0Aint%20fractionalSine%28int%20phase%29%20%7B%0A%20%20int%20step%20%3D%20%28phase%20%3E%3E%206%29%20%26%20255%3B%0A%20%20int%20value%20%3D%20sine128%28step%29%3B%0A%20%20return%20value%20%2B%20%28sine128%28step%20%2B%201%29%20-%20value%29%20%2A%20%28phase%20%26%2063%29%20%2F%2064%3B%0A%7D%0A%0Abool%20frontFace%28int%20corner%2C%20int%20axis%2C%20int%20normal%29%20%7B%0A%20%20if%20%28normal%20%3E%3D%20-faceCutoff%20%26%26%20normal%20%3C%3D%20faceCutoff%29%20return%20false%3B%0A%20%20return%20%28%28corner%20%26%20axis%29%20%21%3D%200%29%20%3D%3D%20%28normal%20%3E%200%29%3B%0A%7D%0A%0Aint%20approach%28int%20current%2C%20int%20target%29%20%7B%0A%20%20if%20%28current%20%3C%20target%29%20return%20current%20%2B%201%3B%0A%20%20if%20%28current%20%3E%20target%29%20return%20current%20-%201%3B%0A%20%20return%20current%3B%0A%7D%0A%0Aint%20limited%28int%20value%2C%20int%20lo%2C%20int%20hi%29%20%7B%0A%20%20if%20%28value%20%3C%20lo%29%20return%20lo%3B%0A%20%20if%20%28value%20%3E%20hi%29%20return%20hi%3B%0A%20%20return%20value%3B%0A%7D%0A%0Aint%20wallSpeed%28int%20v%29%20%7B%0A%20%20if%20%28v%20%3C%200%29%20v%20%3D%20-v%3B%0A%20%20if%20%28v%20%3C%2064%29%20v%20%3D%2064%3B%0A%20%20return%20v%3B%0A%7D%0A%0Avoid%20stepTranslation%28%29%20%7B%0A%20%20int%20oldX%20%3D%20velocityX%3B%0A%20%20int%20oldY%20%3D%20velocityY%3B%0A%20%20velocityX%20%3D%20limited%28oldX%20%2B%20force%5B0%5D%2C%20-184%2C%20184%29%3B%0A%20%20velocityY%20%3D%20limited%28oldY%20%2B%20force%5B1%5D%2C%20-184%2C%20184%29%3B%0A%20%20centerX%20%3D%20centerX%20%2B%20%28oldX%20%2B%20velocityX%29%20%2F%202%3B%0A%20%20centerY%20%3D%20centerY%20%2B%20%28oldY%20%2B%20velocityY%29%20%2F%202%3B%0A%7D%0A%0Avoid%20readCommand%28%29%20%7B%0A%20%20int%20cmd%20%3D%200%3B%0A%20%20for%20%28int%20i%20%3D%207%3B%20i%20%3E%3D%200%3B%20i--%29%20cmd%20%3D%202%20%2A%20cmd%20%2B%20digitalRead%28controlPins%5Bi%5D%29%3B%0A%20%20if%20%28cmd%20%3E%20242%20%7C%7C%20cmd%20%3D%3D%20lastCommand%29%20return%3B%0A%20%20lastCommand%20%3D%20cmd%3B%0A%20%20for%20%28int%20i%20%3D%200%3B%20i%20%3C%205%3B%20i%2B%2B%29%20%7B%0A%20%20%20%20int%20digit%20%3D%20cmd%20%25%203%3B%0A%20%20%20%20int%20target%20%3D%200%3B%0A%20%20%20%20if%20%28digit%20%3D%3D%201%29%20target%20%3D%204%3B%0A%20%20%20%20if%20%28digit%20%3D%3D%202%29%20target%20%3D%20-4%3B%0A%20%20%20%20demand%5Bi%5D%20%3D%20target%3B%0A%20%20%20%20cmd%20%3D%20cmd%20%2F%203%3B%0A%20%20%7D%0A%7D%0A%0Avoid%20stepAngularMotion%28%29%20%7B%0A%20%20int%20oldPitch%20%3D%20spinRate%5B0%5D%3B%0A%20%20int%20oldYaw%20%3D%20spinRate%5B1%5D%3B%0A%20%20spinRate%5B0%5D%20%3D%20limited%28oldPitch%20%2B%20force%5B2%5D%2C%2040%2C%20100%29%3B%0A%20%20spinRate%5B1%5D%20%3D%20limited%28oldYaw%20%2B%20force%5B3%5D%2C%2060%2C%20156%29%3B%0A%20%20pitchPhase%20%3D%20%28pitchPhase%20%2B%20%28oldPitch%20%2B%20spinRate%5B0%5D%29%20%2F%202%29%20%26%2016383%3B%0A%20%20yawPhase%20%3D%20%28yawPhase%20%2B%20%28oldYaw%20%2B%20spinRate%5B1%5D%29%20%2F%202%29%20%26%2016383%3B%0A%7D%0A%0Avoid%20stepDepth%28%29%20%7B%0A%20%20int%20oldDepthSpeed%20%3D%20depthVelocity%3B%0A%20%20depthVelocity%20%3D%20limited%28oldDepthSpeed%20%2B%20force%5B4%5D%2C%20-72%2C%2072%29%3B%0A%20%20depthPosition%20%3D%20depthPosition%20%2B%20%28oldDepthSpeed%20%2B%20depthVelocity%29%20%2F%202%3B%0A%20%20if%20%28depthPosition%20%3C%200%29%20%7B%0A%20%20%20%20depthPosition%20%3D%200%3B%0A%20%20%20%20depthVelocity%20%3D%200%3B%0A%20%20%7D%20else%20if%20%28depthPosition%20%3E%209600%29%20%7B%0A%20%20%20%20depthPosition%20%3D%209600%3B%0A%20%20%20%20depthVelocity%20%3D%200%3B%0A%20%20%7D%0A%7D%0A%0A%2F%2F%20Expand%20the%20fixed-point%20coordinate%20without%20exceeding%20signed%2016-bit%20range.%0Aint%20canvasCoordinate%28int%20coordinate%29%20%7B%0A%20%20return%209%20%2A%20%28coordinate%20%2F%20256%29%20%2B%20%289%20%2A%20%28coordinate%20%25%20256%29%20%2B%20128%29%20%2F%20256%3B%0A%7D%0A%0Avoid%20updateCube%28bool%20advance%29%20%7B%0A%20%20int%20sa%20%3D%20fractionalSine%28pitchPhase%29%3B%0A%20%20int%20ca%20%3D%20fractionalSine%28pitchPhase%20%2B%204096%29%3B%0A%20%20int%20sb%20%3D%20fractionalSine%28yawPhase%29%3B%0A%20%20int%20cb%20%3D%20fractionalSine%28yawPhase%20%2B%204096%29%3B%0A%0A%20%20int%20xFromY%20%3D%2018%20%2A%20%28sa%20%2A%20sb%20%2F%20128%29%3B%0A%20%20int%20xFromZ%20%3D%2018%20%2A%20%28ca%20%2A%20sb%20%2F%20128%29%3B%0A%20%20int%20xFromX%20%3D%2018%20%2A%20cb%3B%0A%20%20int%20yFromY%20%3D%2018%20%2A%20ca%3B%0A%20%20int%20yFromZ%20%3D%2018%20%2A%20sa%3B%0A%20%20int%20zFromY%20%3D%20sa%20%2A%20cb%20%2F%20128%3B%0A%20%20int%20zFromZ%20%3D%20ca%20%2A%20cb%20%2F%20128%3B%0A%20%20int%20dFromY%20%3D%2018%20%2A%20zFromY%3B%0A%20%20int%20dFromZ%20%3D%2018%20%2A%20zFromZ%3B%0A%20%20int%20dFromX%20%3D%20-18%20%2A%20sb%3B%0A%20%20int%20cameraDistance%20%3D%2064%20%2B%20depthPosition%20%2F%20128%3B%0A%20%20faceCutoff%20%3D%20768%20%2F%20cameraDistance%3B%0A%20%20int%20minX%20%3D%201024%2C%20maxX%20%3D%20-1024%3B%0A%20%20int%20minY%20%3D%201024%2C%20maxY%20%3D%20-1024%3B%0A%20%20for%20%28int%20v%20%3D%200%3B%20v%20%3C%208%3B%20v%2B%2B%29%20%7B%0A%20%20%20%20int%20x%20%3D%20%28v%20%26%201%29%20%3F%20xFromX%20%3A%20-xFromX%3B%0A%20%20%20%20int%20y%20%3D%20%28v%20%26%202%29%20%3F%20xFromY%20%3A%20-xFromY%3B%0A%20%20%20%20int%20z%20%3D%20%28v%20%26%204%29%20%3F%20xFromZ%20%3A%20-xFromZ%3B%0A%20%20%20%20int%20rawX%20%3D%20%28x%20%2B%20y%20%2B%20z%29%20%2F%2016%3B%0A%20%20%20%20int%20rawY%20%3D%20%28%28%28v%20%26%204%29%20%3F%20yFromZ%20%3A%20-yFromZ%29%20-%20%28%28v%20%26%202%29%20%3F%20yFromY%20%3A%20-yFromY%29%29%20%2F%2016%3B%0A%20%20%20%20int%20dx%20%3D%20%28v%20%26%201%29%20%3F%20dFromX%20%3A%20-dFromX%3B%0A%20%20%20%20int%20dy%20%3D%20%28v%20%26%202%29%20%3F%20dFromY%20%3A%20-dFromY%3B%0A%20%20%20%20int%20dz%20%3D%20%28v%20%26%204%29%20%3F%20dFromZ%20%3A%20-dFromZ%3B%0A%20%20%20%20int%20distance%20%3D%20cameraDistance%20-%20%28dx%20%2B%20dy%20%2B%20dz%29%20%2F%20320%3B%0A%20%20%20%20int%20xPos%20%3D%2064%20%2A%20rawX%20%2F%20distance%3B%0A%20%20%20%20int%20yPos%20%3D%2064%20%2A%20rawY%20%2F%20distance%3B%0A%20%20%20%20px%5Bv%5D%20%3D%20xPos%3B%0A%20%20%20%20py%5Bv%5D%20%3D%20yPos%3B%0A%20%20%20%20if%20%28xPos%20%3C%20minX%29%20minX%20%3D%20xPos%3B%0A%20%20%20%20if%20%28xPos%20%3E%20maxX%29%20maxX%20%3D%20xPos%3B%0A%20%20%20%20if%20%28yPos%20%3C%20minY%29%20minY%20%3D%20yPos%3B%0A%20%20%20%20if%20%28yPos%20%3E%20maxY%29%20maxY%20%3D%20yPos%3B%0A%20%20%7D%0A%0A%20%20if%20%28advance%29%20stepTranslation%28%29%3B%0A%0A%20%20int%20lowX%20%3D%20-32%20%2A%20minX%3B%0A%20%20int%20lowY%20%3D%20-32%20%2A%20minY%3B%0A%20%20int%20highX%20%3D%2028928%20-%2032%20%2A%20maxX%3B%0A%20%20int%20highY%20%3D%2028928%20-%2032%20%2A%20maxY%3B%0A%20%20if%20%28centerX%20%3C%20lowX%29%20%7B%0A%20%20%20%20centerX%20%3D%20lowX%3B%0A%20%20%20%20velocityX%20%3D%20wallSpeed%28velocityX%29%3B%0A%20%20%7D%20else%20if%20%28centerX%20%3E%20highX%29%20%7B%0A%20%20%20%20centerX%20%3D%20highX%3B%0A%20%20%20%20velocityX%20%3D%20-wallSpeed%28velocityX%29%3B%0A%20%20%7D%0A%20%20if%20%28centerY%20%3C%20lowY%29%20%7B%0A%20%20%20%20centerY%20%3D%20lowY%3B%0A%20%20%20%20velocityY%20%3D%20wallSpeed%28velocityY%29%3B%0A%20%20%7D%20else%20if%20%28centerY%20%3E%20highY%29%20%7B%0A%20%20%20%20centerY%20%3D%20highY%3B%0A%20%20%20%20velocityY%20%3D%20-wallSpeed%28velocityY%29%3B%0A%20%20%7D%0A%0A%0A%0A%20%20for%20%28int%20v%20%3D%200%3B%20v%20%3C%208%3B%20v%2B%2B%29%20%7B%0A%20%20%20%20px%5Bv%5D%20%3D%20canvasCoordinate%28centerX%20%2B%2032%20%2A%20px%5Bv%5D%29%3B%0A%20%20%20%20py%5Bv%5D%20%3D%20canvasCoordinate%28centerY%20%2B%2032%20%2A%20py%5Bv%5D%29%3B%0A%20%20%7D%0A%0A%20%20visible%20%3D%200%3B%0A%20%20int%20bit%20%3D%201%3B%0A%20%20for%20%28int%20e%20%3D%200%3B%20e%20%3C%2012%3B%20e%2B%2B%29%20%7B%0A%20%20%20%20int%20corner%20%3D%20edgeStart%5Be%5D%3B%0A%20%20%20%20if%20%28%28e%20%3E%3D%204%20%26%26%20frontFace%28corner%2C%201%2C%20-sb%29%29%20%7C%7C%0A%20%20%20%20%20%20%20%20%28%28e%20%3C%204%20%7C%7C%20e%20%3E%3D%208%29%20%26%26%20frontFace%28corner%2C%202%2C%20zFromY%29%29%20%7C%7C%0A%20%20%20%20%20%20%20%20%28e%20%3C%208%20%26%26%20frontFace%28corner%2C%204%2C%20zFromZ%29%29%29%20visible%20%3D%20visible%20%2B%20bit%3B%0A%20%20%20%20bit%20%3D%202%20%2A%20bit%3B%0A%20%20%7D%0A%7D%0A%0Avoid%20setup%28%29%20%7B%0A%20%20chipName%28%22114%20x%20114%20Motion%20Control%20Cube%22%29%3B%0A%20%20logicFamily%28CMOS%29%3B%0A%20%20pin%281%2C%20%22ACK%22%2C%20OUTPUT%29%3B%0A%20%20pin%282%2C%20%22TICK%22%2C%20INPUT%29%3B%0A%20%20pin%283%2C%20%22A7%22%2C%20INPUT%29%3B%0A%20%20pin%284%2C%20%22A6%22%2C%20INPUT%29%3B%0A%20%20pin%285%2C%20%22A5%22%2C%20INPUT%29%3B%0A%20%20pin%286%2C%20%22A4%22%2C%20INPUT%29%3B%0A%20%20pin%287%2C%20%22A3%22%2C%20INPUT%29%3B%0A%20%20pin%288%2C%20%22A2%22%2C%20INPUT%29%3B%0A%20%20pin%289%2C%20%22A1%22%2C%20INPUT%29%3B%0A%20%20pin%2810%2C%20%22A0%22%2C%20INPUT%29%3B%0A%20%20pin%2819%2C%20%22GND%22%2C%20GROUND%29%3B%0A%20%20pin%2820%2C%20%225V%22%2C%20POWER%29%3B%0A%20%20digitalWrite%281%2C%20LOW%29%3B%0A%20%20updateCube%28false%29%3B%0A%7D%0A%0Avoid%20loop%28%29%20%7B%0A%20%20bool%20strobe%20%3D%20digitalRead%282%29%20%21%3D%200%3B%0A%20%20if%20%28strobe%20%21%3D%20ackHigh%29%20%7B%0A%20%20%20%20ackHigh%20%3D%20strobe%3B%0A%20%20%20%20digitalWrite%281%2C%20strobe%20%3F%20HIGH%20%3A%20LOW%29%3B%0A%20%20%20%20if%20%28strobe%29%20%7B%0A%20%20%20%20%20%20readCommand%28%29%3B%0A%20%20%20%20%20%20tickPending%20%3D%20true%3B%0A%20%20%20%20%7D%0A%20%20%20%20return%3B%0A%20%20%7D%0A%20%20if%20%28tickPending%29%20%7B%0A%20%20%20%20tickPending%20%3D%20false%3B%0A%20%20%20%20for%20%28int%20i%20%3D%200%3B%20i%20%3C%205%3B%20i%2B%2B%29%20force%5Bi%5D%20%3D%20approach%28force%5Bi%5D%2C%20demand%5Bi%5D%29%3B%0A%20%20%20%20stepAngularMotion%28%29%3B%0A%20%20%20%20stepDepth%28%29%3B%0A%20%20%20%20updateCube%28true%29%3B%0A%20%20%7D%0A%7D%0A%0Avoid%20draw%28%29%20%7B%0A%20%20int%20width%20%3D%20chipWidth%28%29%3B%0A%20%20int%20height%20%3D%20chipHeight%28%29%3B%0A%20%20if%20%28width%20%3C%201026%20%7C%7C%20height%20%3C%201026%29%20return%3B%0A%20%20int%20left%20%3D%20%28width%20-%201026%29%20%2F%202%3B%0A%20%20int%20top%20%3D%20%28height%20-%201026%29%20%2F%202%3B%0A%20%20setColor%28255%2C%20170%2C%2034%29%3B%0A%20%20fillRect%28left%2C%20top%2C%201026%2C%201026%29%3B%0A%20%20setColor%280%2C%200%2C%200%29%3B%0A%20%20int%20mask%20%3D%20visible%3B%0A%20%20for%20%28int%20e%20%3D%200%3B%20e%20%3C%2012%3B%20e%2B%2B%29%20%7B%0A%20%20%20%20if%20%28%28mask%20%26%201%29%20%21%3D%200%29%20%7B%0A%20%20%20%20%20%20int%20a%20%3D%20edgeStart%5Be%5D%3B%0A%20%20%20%20%20%20int%20b%20%3D%20edgeEnd%5Be%5D%3B%0A%20%20%20%20%20%20if%20%28px%5Ba%5D%20%21%3D%20px%5Bb%5D%20%7C%7C%20py%5Ba%5D%20%21%3D%20py%5Bb%5D%29%20%7B%0A%20%20%20%20%20%20%20%20drawLine%28left%20%2B%20px%5Ba%5D%2C%20top%20%2B%20py%5Ba%5D%2C%20left%20%2B%20px%5Bb%5D%2C%20top%20%2B%20py%5Bb%5D%29%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20mask%20%3D%20mask%20%3E%3E%201%3B%0A%20%20%7D%0A%20%20setDefaultColor%28%29%3B%0A%7D%0A 20 customSize 34 34 R 256 480 256 448 0 0 1 7.2 0 0 0.5 g 352 448 320 448 0 r 1632 320 1696 320 0 330 2 g 1696 320 1760 320 0 R 1696 384 1792 384 0 0 1 5 0 0 0.5 g 1696 416 1792 416 0 162 1120 320 1184 320 259 2.1024259 1E-14 0 0 0.0534820556640625 1 0.880126953125 w 1184 320 1632 320 0 0 0 0 0 w 544 672 576 672 0 0 0 0 0 w 544 640 576 640 0 0 0 0 0 w 544 608 576 608 0 0 0 0 0 w 544 576 576 576 0 0 0 0 0 w 544 544 576 544 0 0 0 0 0 w 544 512 576 512 0 0 0 0 0 w 544 480 576 480 0 0 0 0 0 w 544 448 576 448 0 0 0 0 0 w 544 416 576 416 0 0 0 0 0 w 544 384 576 384 0 0 0 0 0 w 544 320 1120 320 0 0 0 0 0 w 256 480 352 480 0 0 0 0 0