This file contains hidden or 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
| Basic Manual for DaFit Fitness Tracker firmware update protocol, works for nearly any nRF52832 tracker from Company DaFit | |
| The minimum size of update file is 0x10000(can be filled with garbage to get to size) and the maximum size is 0x2F000 | |
| the update will first get stored onto the external flash at position 0x3D1000 by the stock firmware(not by the bootloader) | |
| the size of the update will get stored at 0x3D0000 on external flash with 4 bytes uint32_t | |
| when bootloader gets activated it will copy the update from external flash to 0x23000 of the nRF52 internal flash. | |
| Connect to device, |
This file contains hidden or 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
| // based on the math here: | |
| // http://math.stackexchange.com/a/1367732 | |
| // x1,y1 is the center of the first circle, with radius r1 | |
| // x2,y2 is the center of the second ricle, with radius r2 | |
| function intersectTwoCircles(x1,y1,r1, x2,y2,r2) { | |
| var centerdx = x1 - x2; | |
| var centerdy = y1 - y2; | |
| var R = Math.sqrt(centerdx * centerdx + centerdy * centerdy); | |
| if (!(Math.abs(r1 - r2) <= R && R <= r1 + r2)) { // no intersection |
This file contains hidden or 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
| function tableToJson(table) { | |
| var data = []; | |
| // first row needs to be headers | |
| var headers = []; | |
| for (var i=0; i<table.rows[0].cells.length; i++) { | |
| headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,''); | |
| } | |
| // go through cells |
This file contains hidden or 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
| import cv2 | |
| import numpy as np | |
| from matplotlib import pyplot as plt | |
| # Import our game board | |
| canvas = cv2.imread('./data/box_med.jpg') | |
| # Import our piece (we are going to use a clump for now) | |
| piece = cv2.imread('./data/piece_small.jpg') | |
| # Pre-process the piece |