This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const uint8_t threshold = 10; | |
// Search for the furthest left and furthest right pixels in 'row' | |
// which are at least as bright as 'maxval - threshold', starting at 'start_idx' | |
static void search_row(uint8_t *row, int len, int start_idx, uint8_t maxval, | |
int *left_out, int *right_out) | |
{ | |
int i; | |
int left = start_idx; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pio/hub75/hub75.c b/pio/hub75/hub75.c | |
index 1d04b6c..2f2dd45 100644 | |
--- a/pio/hub75/hub75.c | |
+++ b/pio/hub75/hub75.c | |
@@ -41,6 +41,96 @@ int main() { | |
uint sm_data = 0; | |
uint sm_row = 1; | |
+ { | |
+ // Quick and dirty FM6126A initialisation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fn = 64; | |
// =========================================================================== | |
// Helpers and utility for calculating the d-shaft polygon | |
function arc_points(centre = [0, 0], start = 0, angle = 180, radius = 5) = | |
let( | |
points = [ | |
for (theta = [ start : sign(angle) * 360 / $fn : start + angle]) | |
centre + [radius * cos(theta), radius * sin(theta)], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Build the two apps: | |
``` | |
gcc -L/opt/vc/lib -I/opt/vc/include -o p1 -l vcsm p1.c | |
gcc -L/opt/vc/lib -I/opt/vc/include -o p2 -l vcsm p2.c | |
``` | |
Run p1, then run p2 in another shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SteamVR System Report created Fri Oct 20 23:33:13 2017 | |
<Report> | |
SteamVR Version: 1508466289 | |
SteamVR Date: 2017-10-20 | |
Steam: Public | |
Steam Branch: beta | |
Steam AppID: 250820 | |
Tracking: lighthouse | |
OS: Linux version 4.13.7-1-ARCH (builduser@tobias) (gcc version 7.2.0 (GCC)) #1 SMP PREEMPT Sat Oct 14 20:13:26 CEST 2017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* C equivalent of the "slow in-memory" Java code from this "paper": | |
* http://arxiv.org/pdf/1503.02678v1.pdf | |
* Apparently it takes 274 seconds on Java6! | |
* | |
* $ time ./a.out | |
* | |
* real 0m42.023s | |
* user 0m31.880s | |
* sys 0m10.137s | |
*/ |