Skip to content

Commit b7611de

Browse files
committed
0.1.11 Angle
1 parent 0f5a750 commit b7611de

File tree

10 files changed

+66
-39
lines changed

10 files changed

+66
-39
lines changed

libraries/Angle/.arduino-ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ compile:
22
# Choosing to run compilation tests on 2 different Arduino platforms
33
platforms:
44
- uno
5-
- leonardo
6-
- due
7-
- zero
5+
# - due
6+
# - zero
7+
# - leonardo
8+
- m4
9+
- esp32
10+
# - esp8266
11+
# - mega2560

libraries/Angle/.github/workflows/arduino_test_runner.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ name: Arduino CI
44
on: [push, pull_request]
55

66
jobs:
7-
arduino_ci:
7+
runTest:
88
runs-on: ubuntu-latest
99

1010
steps:
1111
- uses: actions/checkout@v2
12-
- uses: Arduino-CI/action@master
13-
# Arduino-CI/[email protected]
12+
- uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: 2.6
15+
- run: |
16+
gem install arduino_ci
17+
arduino_ci.rb

libraries/Angle/Angle.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
//
22
// FILE: Angle.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.10
4+
// VERSION: 0.1.11
55
// PURPOSE: library for Angle math for Arduino
66
// URL: https://github.com/RobTillaart/Angle
77
// http://forum.arduino.cc/index.php?topic=339402
88
//
9-
// 0.1.10 2021-01-16 readme.md + minor refactor
10-
// 0.1.9 2020-12-10 Arduino ci
11-
// 0.1.8 2020-05-27 update library.json
12-
// 0.1.7 2020-03-26 refactor #pragma once
13-
// 0.1.06 fixed bug negative values.
14-
// 0.1.05 added AngleFormat proxy added 03/03/15 by Christoper Andrews.
15-
// 0.1.04 changed thousands in tenthousands, string constructor
16-
// 0.1.03 added URL, fromRadians [TEST]
17-
// 0.1.02 added toRadians() + fix compare()
18-
// 0.1.01 cleanup a bit
9+
// HISTORY
1910
// 0.1.00 initial version
11+
// 0.1.01 cleanup a bit
12+
// 0.1.02 added toRadians() + fix compare()
13+
// 0.1.03 added URL, fromRadians [TEST]
14+
// 0.1.04 changed thousands in tenthousands, string constructor
15+
// 0.1.05 added AngleFormat proxy added 03/03/15 by Christoper Andrews.
16+
// 0.1.06 fixed bug negative values.
17+
// 0.1.7 2020-03-26 refactor #pragma once
18+
// 0.1.8 2020-05-27 update library.json
19+
// 0.1.9 2020-12-10 Arduino ci
20+
// 0.1.10 2021-01-16 readme.md + minor refactor
21+
// 0.1.11 2021-10-17 update build-ci,
2022

2123

2224
#include "Angle.h"
@@ -118,9 +120,9 @@ Angle::Angle(char * str)
118120
yy *= 10;
119121
}
120122
// convert float to degrees. 1000000000 ~> 36000000 -> /250 * 9
121-
// yy = yy * 4 / 125 + yy / 250; // just keeps the math within 32 bits
123+
// yy = yy * 4 / 125 + yy / 250; // just keeps the maths within 32 bits
122124
yy = yy * 4 / 125;
123-
yy = yy + (yy + 4)/ 8; // just keeps the math within 32 bits
125+
yy = yy + (yy + 4)/ 8; // just keeps the maths within 32 bits
124126
// split yy in m, s, tt
125127
t = yy % 10000UL;
126128
yy = yy / 10000UL;

libraries/Angle/Angle.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22
//
33
// FILE: Angle.h
4-
// AUTHOR: Rob dot Tillaart at gmail dot com
5-
// VERSION: 0.1.10
4+
// AUTHOR: Rob Tillaart
5+
// VERSION: 0.1.11
66
// PURPOSE: angle library for Arduino
77
// HISTORY: See angle.cpp
88
//
@@ -15,7 +15,7 @@
1515
#include "Printable.h"
1616

1717

18-
#define ANGLE_LIB_VERSION (F("0.1.10"))
18+
#define ANGLE_LIB_VERSION (F("0.1.11"))
1919

2020

2121
class Angle;

libraries/Angle/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11

22
[![Arduino CI](https://github.com/RobTillaart/Angle/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
3+
[![Arduino-lint](https://github.com/RobTillaart/Angle/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Angle/actions/workflows/arduino-lint.yml)
4+
[![JSON check](https://github.com/RobTillaart/Angle/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Angle/actions/workflows/jsoncheck.yml)
35
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Angle/blob/master/LICENSE)
46
[![GitHub release](https://img.shields.io/github/release/RobTillaart/Angle.svg?maxAge=3600)](https://github.com/RobTillaart/Angle/releases)
57

68

79
# Angle
810

9-
Arduino library for basic math for Angles in degrees, minute, seconds and tenthousands.
11+
Arduino library for basic math for Angles in degrees, minute, seconds and ten-thousands.
1012

1113

1214
## Description
1315

14-
Angle is an Arduino class to print, compare and do basic math with angles
15-
in degrees, minutes seconds and tenthousands. The class was created to be
16+
Angle is an Arduino class to print, compare and do basic maths with angles
17+
in degrees, minutes seconds and ten-thousands. The class was created to be
1618
able to print an angle with minutes and seconds instead of as a floating point
1719
or radians.
1820

19-
To make the library more useful basic math ( + - \* / )
21+
To make the library more useful basic maths ( + - \* / )
2022
and comparisons ( == != < <= > >= ) are added to the class.
2123

2224
The library implements the Printable interface, allowing one to call
@@ -30,7 +32,7 @@ The library implements the Printable interface, allowing one to call
3032

3133
- **Angle(int dd=0, int mm=0, int ss=0, int tt=0)** create an Angle, default is zero.
3234
- **Angle(double alpha)** create an Angle from a double.
33-
- **Angle(char \* str)** creat an Angle from a string e.g. "45.31234".
35+
- **Angle(char \* str)** create an Angle from a string e.g. "45.31234".
3436

3537

3638
### base
@@ -39,14 +41,14 @@ The library implements the Printable interface, allowing one to call
3941
- **int degree()** returns # degrees
4042
- **int minute()** returns # minutes
4143
- **int second()** returns # seconds
42-
- **int tenthousand()** returns # tenthousands of a second
44+
- **int tenthousand()** returns # ten-thousands of a second
4345

4446

4547
### Conversions
4648

47-
- **toDouble()** returns the angle as a double (float)
48-
- **toRadians()** retuns the angle in radians (0..TWO_PI)
49-
- **fromRadian()**
49+
- **double toDouble()** returns the angle as a double (0..360.0, float on UNO)
50+
- **double toRadians()** returns the angle in radians (0..TWO_PI)
51+
- **void fromRadian(double rad)** create an angle from radians.
5052

5153

5254
### Equality operators

libraries/Angle/examples/test_angle01/test_angle01.ino

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
//
22
// FILE: test_angle01.ino
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.1.03
54
// PURPOSE: demo sketch to test angle class
65
// DATE: 2015-07-30
7-
// URL:
8-
//
9-
// Released to the public domain
6+
// URL: https://github.com/RobTillaart/Angle.git
107
//
118

9+
1210
#include "Angle.h"
1311

12+
1413
Angle a(1, 2, 3, 4);
1514
Angle b(45, 30);
1615
Angle c(2, 3, 4, 5);
@@ -22,6 +21,7 @@ Angle bb(0, -2, 3, 45);
2221
Angle cc(0, 0, -3, 45);
2322
Angle dd(0, 0, 0, -45);
2423

24+
2525
void testConstructors()
2626
{
2727
Serial.println("\n1. print -- Angle(d, m, s, t)");
@@ -64,6 +64,7 @@ void testConstructors()
6464
Serial.println(vv);
6565
}
6666

67+
6768
void testToDouble()
6869
{
6970
Serial.println("\n2.1 toDouble -- Angle(double) toRadians()");
@@ -116,6 +117,7 @@ void testToDouble()
116117
Serial.println();
117118
}
118119

120+
119121
void testParts()
120122
{
121123
Serial.println("\n3. degrees, minutes, seconds, thousands");
@@ -134,6 +136,7 @@ void testParts()
134136
Serial.println(cc.tenthousand());
135137
}
136138

139+
137140
void testCompare()
138141
{
139142
Serial.println("\n4. Compare: a op a op: == != < <= > >=");
@@ -186,6 +189,7 @@ void testCompare()
186189
Serial.println();
187190
}
188191

192+
189193
void testNegate()
190194
{
191195
Serial.println("\n6. negate ");
@@ -204,6 +208,7 @@ void testNegate()
204208
Serial.println(-ww);
205209
}
206210

211+
207212
void testAdd()
208213
{
209214
Serial.println("\n7.1 Add +");
@@ -309,6 +314,7 @@ void testAdd()
309314
}
310315
}
311316

317+
312318
void testSubtract()
313319
{
314320
Serial.println("\n8.1 Subtract -");
@@ -397,6 +403,7 @@ void testSubtract()
397403

398404
}
399405

406+
400407
void testMultiply()
401408
{
402409
Serial.println("\n9. Multiply * *=");
@@ -408,6 +415,7 @@ void testMultiply()
408415
Serial.println(a);
409416
}
410417

418+
411419
void testDivide()
412420
{
413421
Serial.println("\n10. Divide / /=");
@@ -420,6 +428,7 @@ void testDivide()
420428
Serial.println(d);
421429
}
422430

431+
423432
void testRatio()
424433
{
425434
Serial.println("\n11. Ratio");
@@ -457,6 +466,11 @@ void setup()
457466
Serial.println("\nDone...");
458467
}
459468

469+
460470
void loop()
461471
{
462472
}
473+
474+
475+
// -- END OF FILE --
476+

libraries/Angle/keywords.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Syntax Coloring Map For Angle
1+
# Syntax Colouring Map For Angle
22

3-
# Datatypes (KEYWORD1)
3+
# Data types (KEYWORD1)
44
Angle KEYWORD1
55
AngleFormatMode KEYWORD1
66
AngleFormat KEYWORD1

libraries/Angle/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"type": "git",
2121
"url": "https://github.com/RobTillaart/Angle.git"
2222
},
23-
"version": "0.1.10",
23+
"version": "0.1.11",
2424
"license": "MIT",
2525
"frameworks": "arduino",
2626
"platforms": "*"

libraries/Angle/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Angle
2-
version=0.1.10
2+
version=0.1.11
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Library to convert between floating point angle to minutes hours representation.

libraries/Angle/test/unit_test_001.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// assertNAN(arg); // isnan(a)
3131
// assertNotNAN(arg); // !isnan(a)
3232

33+
3334
#include <ArduinoUnitTests.h>
3435

3536
#include "Arduino.h"

0 commit comments

Comments
 (0)