Code Monkey home page Code Monkey logo

nixiedisplay-hal's Introduction

NixieDisplay HAL

C++ abstraction for controlling up to 6 nixie tubes. Compatible with most platforms that provide standard GPIO write and delay/sleep functions. Put the c++ and h files in a folder called "src" to use with Arduino.

Prerequisites

  • Any modern microcontroller
  • Sufficient GPIO to interface with the tubes, or GPIO expander.

How to use


Declare uint8_t arrays pinout1 through pinout6, containing the control pins for each digit ordered from 0 to 9.

uint8_t pinout1[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
uint8_t pinout2[10] = {....}
...
...
uint8_t pinout6[10] = {....}


Instantiate the NixieDisplay object.

NixieDisplay display(uint8_t active, uint8_t offset, 
uint8_t pinout1[], uint8_t pinout2[], uint8_t pinout3[], uint8_t pinout4[], uint8_t pinout5[], uint8_t pinout6[]);


Initialize display.

display.init();


Write a number to the display.

display.write(uint32_t num);


Or write time to the display.

display.writeTime(struct tm *time);


Clear the display. This blanks the display and may not have the same effect as disabling the nixie tube's power supply.

display.clear();


Option to enable/disable crossfading of digits between write() calls. Defaults to true.

display.setCrossfade(bool crossfade)


Option to enable/disable scrollback of digits between write() calls. Defaults to true.

display.setScrollback(bool scrollback)


Run cathode protection type nixie_display_protection_t for a duration of ms (minimum duration is CATHODE_PROTECTION_INTER_MS*10). Optional parameter CATHODE_PROTECTION_INTER_MS to determine on time of each digit.

display.runProtection(nixie_display_protection_t type, uint32_t ms, uint32_t CATHODE_PROTECTION_INTER_MS = 15);


Add this function to the main.c file. It must contain a platform-specific method for writing to GPIO. Return false if no error.

bool platformGPIOWrite(uint8_t pin, bool data) {
    xxxx.write(pin, data) // write to GPIO expander or other IO device
    return false;
}


Add this function to the main.c file. It must contain a platform-specific method for milisecond delays.

void platformDelayMs(uint32_t ms){
  vTaskDelay(ms);
}

nixiedisplay-hal's People

Contributors

edward62740 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.