Merge pull request #694 from hughbarney/master

removed LCD1.write() as it was keeping the LCD on all the time in the arrow App
pull/695/head
Gordon Williams 2021-03-18 12:44:07 +00:00 committed by GitHub
commit 0c80d43f6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 4 deletions

View File

@ -2897,7 +2897,7 @@
"name": "Arrow Compass", "name": "Arrow Compass",
"icon": "arrow.png", "icon": "arrow.png",
"type":"app", "type":"app",
"version":"0.03", "version":"0.04",
"description": "Moving arrow compass that points North, shows heading, with tilt correction. Based on jeffmer's Navigation Compass", "description": "Moving arrow compass that points North, shows heading, with tilt correction. Based on jeffmer's Navigation Compass",
"tags": "tool,outdoors", "tags": "tool,outdoors",
"readme": "README.md", "readme": "README.md",

View File

@ -1,3 +1,4 @@
0.01: First version 0.01: First version
0.02: Moved arrow image load to global scope 0.02: Moved arrow image load to global scope
0.03: faster drawCompass() function, does not cause buttons to become unresponsive 0.03: faster drawCompass() function, does not cause buttons to become unresponsive
0.04: removed LCD1.write() as it was keeping LCD on

View File

@ -27,7 +27,6 @@ function radians(d) {
function drawCompass(hd) { function drawCompass(hd) {
if(!candraw) return; if(!candraw) return;
if (Math.abs(hd - oldHeading) < 2) return 0; if (Math.abs(hd - oldHeading) < 2) return 0;
var t1 = getTime();
hd=hd*Math.PI/180; hd=hd*Math.PI/180;
var p = [0, 1.1071, Math.PI/4, 2.8198, 3.4633, 7*Math.PI/4 , 5.1760]; var p = [0, 1.1071, Math.PI/4, 2.8198, 3.4633, 7*Math.PI/4 , 5.1760];
@ -44,8 +43,6 @@ function drawCompass(hd) {
buf1.fillPoly(poly); buf1.fillPoly(poly);
flip1(56, 56); flip1(56, 56);
var t = Math.round((getTime() - t1)*1000);
LED1.write((t > 100));
} }
// stops violent compass swings and wobbles, takes 3ms // stops violent compass swings and wobbles, takes 3ms