Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
BarcodeLED.h
00001 /* Copyright (c) 2010 iZsh - izsh at fail0verflow.com 00002 * 00003 * This program is free software: you can redistribute it and/or modify 00004 * it under the terms of the GNU General Public License as published by 00005 * the Free Software Foundation, either version 3 of the License, or 00006 * (at your option) any later version. 00007 * 00008 * This program is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 * GNU General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU General Public License 00014 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00015 */ 00016 #ifndef IZSH_MBED_BARCODELED_H 00017 #define IZSH_MBED_BARCODELED_H 00018 00019 #include "mbed.h" 00020 00021 class BarcodeLED 00022 { 00023 public: 00024 enum CodeType 00025 { 00026 Code39, 00027 Code128a = 103, 00028 Code128b = 104, 00029 Code128c = 105, 00030 }; 00031 00032 BarcodeLED(const PinName Led, const CodeType Codetype = Code39, const int BaseDelay = 20); 00033 00034 CodeType GetCodetype(); 00035 void SetCodetype(const CodeType Codetype); 00036 00037 int GetBaseDelay(); 00038 void SetBaseDelay(const int BaseDelay); 00039 00040 int GetVerbose(); 00041 void SetVerbose(const bool Verbose); 00042 00043 void Emit(const char Str[]); 00044 00045 private: 00046 00047 void EmitCode39(const char Str[]); 00048 void EmitCode128(const char Str[]); 00049 00050 int ASCII2Code39(const char C); 00051 int ASCII2Code128(const char C); 00052 00053 char * RevStr(char Str[]); 00054 void FlashSeq(const char Seq[]); 00055 00056 int Code128Checksum(const char Str[]); 00057 00058 DigitalOut m_Led; 00059 CodeType m_Codetype; 00060 int m_BaseDelay; 00061 bool m_Verbose; 00062 00063 static const char * m_Barcode39[]; 00064 static const char * m_Barcode128[]; 00065 }; 00066 00067 00068 #endif
Generated on Fri Jul 15 2022 20:45:35 by
1.7.2