mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-09-19 16:46:11 -04:00
0.2.2 Par27979
This commit is contained in:
parent
72671b205f
commit
3f286ae8ab
@ -2,6 +2,10 @@ compile:
|
||||
# Choosing to run compilation tests on 2 different Arduino platforms
|
||||
platforms:
|
||||
- uno
|
||||
- leonardo
|
||||
- due
|
||||
- zero
|
||||
# - leonardo
|
||||
# - m4
|
||||
- esp32
|
||||
- esp8266
|
||||
- mega2560
|
||||
|
@ -4,10 +4,14 @@ name: Arduino CI
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
arduino_ci:
|
||||
runTest:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: Arduino-CI/action@master
|
||||
# Arduino-CI/action@v0.1.1
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- run: |
|
||||
gem install arduino_ci
|
||||
arduino_ci.rb
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: PAR27979.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.0
|
||||
// VERSION: 0.2.2
|
||||
// PURPOSE: Arduino library for Parallax 27979 _serial LCD display
|
||||
// URL: https://github.com/RobTillaart/PAR27979
|
||||
//
|
||||
@ -11,12 +11,17 @@
|
||||
// 0.2.0 2020-06-23 complete redo as class
|
||||
// also support for 27976, 27977 (not tested)
|
||||
// 0.2.1 2021-01-03 Arduino-CI + unit test
|
||||
// 0.2.2 2021-11-10 Update Arduino-CI,
|
||||
// update readme.md + badges,
|
||||
// fix version number
|
||||
// update Print interface
|
||||
|
||||
|
||||
#define PAR27929_VERSION (F("0.2.1"))
|
||||
#define PAR27929_LIB_VERSION (F("0.2.2"))
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
|
||||
class PAR27979 : public Print
|
||||
{
|
||||
public:
|
||||
@ -64,6 +69,11 @@ public:
|
||||
|
||||
// PRINT interface
|
||||
size_t write(const uint8_t data) { return _ser->write(data); };
|
||||
size_t write(const uint8_t * data, uint8_t length)
|
||||
{
|
||||
return _ser->write(data, length);
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
Stream *_ser;
|
||||
|
@ -15,6 +15,7 @@ SoftwareSerial sws(3, 3);
|
||||
|
||||
PAR27979 display(&sws);
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
sws.begin(19200); // max speed parallax display
|
||||
@ -72,7 +73,10 @@ void setup()
|
||||
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// -- END OF FILE --
|
||||
|
@ -7,10 +7,12 @@
|
||||
// (c) : MIT
|
||||
//
|
||||
|
||||
|
||||
#include "PAR27979.h"
|
||||
|
||||
PAR27979 display(&Serial);
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(19200); // max speed parallax display
|
||||
@ -67,9 +69,10 @@ void setup()
|
||||
display.print("Done...");
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
|
@ -1,18 +1,23 @@
|
||||
# Syntax Coloring Map For PAR27979
|
||||
# Syntax Colouring Map For PAR27979
|
||||
|
||||
# Datatypes (KEYWORD1)
|
||||
|
||||
# Data types (KEYWORD1)
|
||||
PAR27979 KEYWORD1
|
||||
|
||||
|
||||
# Methods and Functions (KEYWORD2)
|
||||
on KEYWORD2
|
||||
off KEYWORD2
|
||||
|
||||
clearHome KEYWORD2
|
||||
backlightOn KEYWORD2
|
||||
backlightOff KEYWORD2
|
||||
|
||||
left KEYWORD2
|
||||
right KEYWORD2
|
||||
down KEYWORD2
|
||||
gotoXY KEYWORD2
|
||||
|
||||
defineCustomChar KEYWORD2
|
||||
customChar KEYWORD2
|
||||
|
||||
@ -21,8 +26,10 @@ duration KEYWORD2
|
||||
play KEYWORD2
|
||||
noSound KEYWORD2
|
||||
|
||||
|
||||
# Instances (KEYWORD2)
|
||||
|
||||
|
||||
# Constants (LITERAL1)
|
||||
|
||||
PAR27929_LIB_VERSION LITERAL1
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/PAR27979.git"
|
||||
},
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*"
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=PAR27979
|
||||
version=0.2.1
|
||||
version=0.2.2
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for Parallax 27979 serial LCD display.
|
||||
|
@ -1,12 +1,15 @@
|
||||
|
||||
[![Arduino CI](https://github.com/RobTillaart/PAR27979/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
||||
[![Arduino-lint](https://github.com/RobTillaart/PAR27979/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/PAR27979/actions/workflows/arduino-lint.yml)
|
||||
[![JSON check](https://github.com/RobTillaart/PAR27979/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/PAR27979/actions/workflows/jsoncheck.yml)
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/PAR27979/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/RobTillaart/PAR27979.svg?maxAge=3600)](https://github.com/RobTillaart/PAR27979/releases)
|
||||
|
||||
|
||||
# PAR27979
|
||||
|
||||
Arduino library for the Parallax 27979 serial display
|
||||
Arduino library for the Parallax 27979 serial display.
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
@ -14,6 +17,7 @@ The library is essentially a wrapper around a Stream, typically Serial,
|
||||
Serial2 (3,4..) or newSoftSerial or equivalent.
|
||||
This stream is given as parameter in the constructor.
|
||||
|
||||
|
||||
## Interface
|
||||
|
||||
The library implements the **Print** interface to print integers
|
||||
@ -22,39 +26,59 @@ floats and strings and all printable types.
|
||||
The library does not keep any state information, it only implements a few
|
||||
methods to make working with it easier.
|
||||
|
||||
|
||||
### Base
|
||||
|
||||
- **PAR27979(Stream \* str)** constructor, used stream as parameter.
|
||||
- **on()** switch display on
|
||||
- **off()** switch display off
|
||||
- **clearHome()** clear the display
|
||||
- **backlightOn()** enable the backlight
|
||||
- **backLightOff()** disable the backlight
|
||||
- **void on()** switch display on.
|
||||
- **void off()** switch display off.
|
||||
- **void clearHome()** clear the display.
|
||||
- **void backlightOn()** enable the backlight.
|
||||
- **void backLightOff()** disable the backlight.
|
||||
|
||||
|
||||
### Cursor Movement
|
||||
|
||||
- **cursorLeft()** move cursor
|
||||
- **cursorRight()** move cursor
|
||||
- **lineFeed()** idem
|
||||
- **formFeed()** idem
|
||||
- **gotoXY(x, y)**
|
||||
- **void left()** move cursor.
|
||||
- **void right()** move cursor.
|
||||
- **void down()** move cursor.
|
||||
- **void gotoXY(uint8_t x, uint8_t y)** idem.
|
||||
|
||||
|
||||
### Custom chars
|
||||
|
||||
see datasheet.
|
||||
|
||||
- **void defineCustomChar(uint8_t idx, uint8_t \* arr)** array will need to be 8 bytes.
|
||||
- **void customChar(uint8_t idx)** idem.
|
||||
|
||||
|
||||
### Sound support
|
||||
|
||||
- **octave(octave)** octave = 3 4 5 6 7
|
||||
- **duration(duration)** duration = 1 2 4 8 16 32 64
|
||||
- **play(note)** note = 0 1 2 3 4 5 6 7 8 9 10 11 0=A 1=A# etc
|
||||
- **noSound()**
|
||||
- **void octave(uint8_t octave)** octave = 3 4 5 6 7
|
||||
- **void duration(uint8_t duration)** duration = 1 2 4 8 16 32 64
|
||||
- **void play(uint8_t note)** note = 0 1 2 3 4 5 6 7 8 9 10 11 0=A 1=A# etc
|
||||
- **void noSound()** idem.
|
||||
|
||||
|
||||
## Support Parallax 27976 & 27977
|
||||
|
||||
Although not tested, the functions should work with the
|
||||
Parallax 27976 and 27977 displays too.
|
||||
|
||||
## Todo
|
||||
|
||||
- baudrate?
|
||||
|
||||
## Operation
|
||||
|
||||
See example
|
||||
See examples.
|
||||
|
||||
## Future
|
||||
|
||||
only extend on a per request basis
|
||||
|
||||
- documentation
|
||||
- different baud rates?
|
||||
- test custom chars
|
||||
- more testing.
|
||||
- test 27976 and 27977 display
|
||||
- extend unit test
|
||||
|
||||
|
@ -43,17 +43,17 @@ unittest_teardown()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// interface gives no feedback so hard to write unit test.
|
||||
// GODMODE with serial
|
||||
|
||||
unittest(test_constructor)
|
||||
{
|
||||
fprintf(stderr, "VERSION: %s\n", PAR27929_VERSION);
|
||||
fprintf(stderr, "VERSION: %s\n", (char *) PAR27929_LIB_VERSION);
|
||||
|
||||
PAR27979 display(&Serial);
|
||||
assertEqual(1, display.write(232)); // no sound
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
unittest_main()
|
||||
|
Loading…
Reference in New Issue
Block a user