GithubHelp home page GithubHelp logo

arduino_barcode128's Introduction

arduino_barcode128

Generates a String representation of a Barcode (code 128)

Example of use

#include <Barcode.h>
Barcode barcode;
// (...)
void drawBarcode(String text)
{
//Call barcode.make with desired string to codify
  String bars = barcode.make(text);
  // Input -> 11648
  // Output -> "211412123221123221223112221231311222132212233111"
  // Each number is a bar length, alternating Black / White
  //Goes through retrieved string, drawing the bars
  for (int i = 0; i < bars.length(); i++){
      int barLen = bars[i] - '0';
      int startBar = posBar;
      posBar+= barLen;
      if (i%2 == 0) {
        display.fillRect(0, startBar, 45, posBar, GxEPD_BLACK);      
      } else {
        display.fillRect(0, startBar, 45, posBar, GxEPD_WHITE);
      }          
  }
  display.updateWindow(0, 0, 45, display.height(), false)
}

arduino_barcode128's People

Contributors

victorheid avatar

Watchers

 avatar

Forkers

wsrtd

arduino_barcode128's Issues

128 bar code should end at 2331112

This library is very good. But I can't scan it with my mobile phone using the barcode generated by it. So I looked up a lot of information and found that the end of the bar code was one less.

     // Input -> 11648
    // Output -> "211412123221123221223112221231311222132212233111"

output should be "2114121232211232212231122212313112221322122331112"ใ€‚

String bars = barcode.make(text);

The bars array should end up with a "2".

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.