Skip to content

Commit

Permalink
Version 0.5.0 is committed
Browse files Browse the repository at this point in the history
  • Loading branch information
lexus2k committed May 20, 2017
1 parent f00254f commit f3c2a97
Show file tree
Hide file tree
Showing 27 changed files with 106 additions and 514 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ The library supports the following devices:
For more information about this library please visit
https://github.com/lexus2k/nixielib.
If you found any problem, please report to Issues section.
The library depends on NixieOs library:
https://github.com/lexus2k/NixieOs.

== License ==

Expand Down
5 changes: 3 additions & 2 deletions examples/nixie_audio_demo/nixie_audio_demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <nixie_library.h>
#include <nixieos.h>
#include <nixie_audio_channel.h>
#include <nixie_melodies.h>

Expand All @@ -27,12 +27,13 @@ NixieAudioChannel s_audio(3);

void setup()
{
NixieOs::setup( nullptr );
s_audio.init();
}

void loop()
{
NixieLibrary::update();
NixieOs::refresh();
s_audio.update(micros());
if (!s_audio.isPlaying( ))
{
Expand Down
6 changes: 4 additions & 2 deletions examples/nixie_buttons_demo/nixie_buttons_demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
*
*/

#include <nixie_library.h>
#include <nixieos.h>
#include <nixie_buttons.h>
#include <nixieos.h>

// BTN1 BTN2 BTN3 BTN4
const int16_t buttons[4] = { 752, 542, 362, 188 };
Expand All @@ -44,14 +45,15 @@ void onButtonDown(uint8_t id, uint16_t timeDeltaMs)

void setup()
{
NixieOs::setup( nullptr );
Serial.begin(9600);
s_buttons.init();
s_buttons.onButtonDown(&onButtonDown);
}

void loop()
{
NixieLibrary::update();
NixieOs::refresh();
s_buttons.update();
if (s_buttons.isShortPress(0))
{
Expand Down
5 changes: 3 additions & 2 deletions examples/nixie_htu21/nixie_htu21.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* HTU21 sensor is connected to I2C bus, and is powered from 3.3V supply.
*/

#include <nixie_library.h>
#include <nixieos.h>
#include <nixie_htu21.h>

static NixieHTU21 s_htu21;
Expand All @@ -40,13 +40,14 @@ void onButtonDown(uint8_t id, uint16_t timeDeltaMs)

void setup()
{
NixieOs::setup( nullptr );
Serial.begin(9600);
s_htu21.init();
}

void loop()
{
NixieLibrary::update();
NixieOs::refresh();
int16_t temp = s_htu21.getTemperature();
Serial.print("Temperature: ");
Serial.println(temp/100); /* Print temperature in Celsius */
Expand Down
5 changes: 3 additions & 2 deletions examples/nixie_single_tube/nixie_single_tube.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <nixie_tube.h>
#include <nixie_k155id1.h>
#include <nixie_library.h>
#include <nixieos.h>

/*
* In this example single Nixie Tubes is controlled through single K155ID1 chip.
Expand Down Expand Up @@ -31,6 +31,7 @@ NixieTube g_tube(&g_driver, in14driverMap);

void setup()
{
NixieOs::setup( nullptr );
Serial.begin(9600);
g_tube.init();
/* Start with zero-digit. Zero means that we start from 0-digit */
Expand All @@ -45,7 +46,7 @@ void loop()
{
static unsigned long timestamp = millis();
/* The line below must be called in the beginning of each loop cycle */
NixieLibrary::update();
NixieOs::refresh();
if (millis() - timestamp > 1000)
{
/* enumerate all digits one by one every 1000 mseconds */
Expand Down
7 changes: 4 additions & 3 deletions examples/nixie_two_tubes/nixie_two_tubes.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <nixie_display.h>
#include <nixie_k155id1.h>
#include <nixie_library.h>
#include <nixieos.h>

/*
* In this example both Nixie Tubes are controlled through single K155ID1 chip.
Expand Down Expand Up @@ -39,6 +39,7 @@ NixieDisplay g_display(g_driver, anodPins, in14driverMap, 2);

void setup()
{
NixieOs::setup( nullptr );
Serial.begin(9600);
g_display.init();
/* Start with zero-digit. Index corresponds to the tube, we're referring to. */
Expand All @@ -48,14 +49,14 @@ void setup()
* Display object will automatically call anodOn() and anodOff(), while
* functioning. Refer to NixieDisplay::render() method
*/
g_display.turnOn();
g_display.powerOn();
}

void loop()
{
static unsigned long timestamp = millis();
/* The line below must be called in the beginning of each loop cycle */
NixieLibrary::update();
NixieOs::refresh();
if (millis() - timestamp > 1000)
{
/* enumerate all digits one by one every 1000 mseconds on first tube only */
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=NixieLibrary
version=0.4.0
version=0.5.0
author=Alexey Dynda
maintainer=Alexey Dynda <[email protected]>
sentence=Nixie Library is intended for Nixie Clock software development.
Expand Down
2 changes: 1 addition & 1 deletion src/nixie_audio_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#include <nixie_audio_channel.h>
#include "nixie_booster.h"
#include "nixieos.h"

////////////////////////////////////////////////////////////////////////////////////////////

Expand Down
100 changes: 0 additions & 100 deletions src/nixie_booster.cpp

This file was deleted.

91 changes: 0 additions & 91 deletions src/nixie_booster.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/nixie_buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "nixie_library.h"
#include "nixieos.h"
#include "nixie_buttons.h"

#define BUTTONS_THRESHOLD 30 /// in sample units 0 - 1024
Expand Down
2 changes: 1 addition & 1 deletion src/nixie_buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define _NIXIE_BUTTONS_H_

#include "nixie_types.h"
#include "nixie_booster.h"
#include "nixieos.h"

/**
* TOnButtonEvent defines format of callback functions used by NixieAnalogButtons class
Expand Down
4 changes: 2 additions & 2 deletions src/nixie_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "nixie_library.h"
#include "nixie_display.h"
#include "nixieos.h"

static const uint32_t s_newInterval = ( (uint32_t)CHANGE_INTERVAL * DISPLAY_BRIGHTNESS_RANGE ) / (uint32_t)NIXIE_MAX_BRIGHTNESS;
static const uint32_t s_minChangeInterval = (uint32_t)CHANGE_INTERVAL - s_newInterval;
Expand Down Expand Up @@ -375,7 +375,7 @@ void NixieDisplay::powerOff()
void NixieDisplay::powerOn ()
{
m_powerOn = true;
NixieLibrary::update();
NixieOs::refresh();
for (uint8_t i=0; i<m_maxTubes; i++)
{
m_tubes[i].update();
Expand Down
2 changes: 1 addition & 1 deletion src/nixie_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
*/

#include "nixie_driver.h"
#include "nixie_booster.h"
#include "nixieos.h"

/* Base class NixieDriver doesn't require any specific implementation */
Loading

0 comments on commit f3c2a97

Please sign in to comment.