You are not logged in.

#1 13 Aug 2020 08:25

Minecraft49
Member
From: Poland
Registered: 08 Aug 2020
Posts: 10
Website

7-segment LCD display emulator in Batch

Today I want to show you LCD7, my next batch file that displays a 7-segment LCD display displaying any decimal digit.

:: #     ##  ###  ####
:: #    #  # #  # #  #
:: #    #    #  #    #
:: #    #    #  #   ##
:: #    #    #  #   # 
:: #    #  # #  #   # 
:: ####  ##  ###    # 
:: by Minecraft49.


@echo off
if "%1"=="/?" goto help
if "%1"=="" goto help
setlocal

set a=*
if %1==1 set a=-
if %1==4 set a=-
set b=*
if %1==1 set b=-
if %1==2 set b=-
if %1==3 set b=-
if %1==7 set b=-
set c=*
if %1==5 set c=-
if %1==6 set c=-
set d=*
if %1==1 set d=-
if %1==7 set d=-
set e=-
if %1==2 set e=*
if %1==8 set e=*
if %1==6 set e=*
set f=*
if %1==2 set f=-
set g=*
if %1==1 set g=-
if %1==4 set g=-
if %1==7 set g=-

echo %a%%a%%a%%a%
echo %b%  %c%
echo %b%  %c%
echo %d%%d%%d%%d%
echo %e%  %f%
echo %e%  %f%
echo %g%%g%%g%%g%
endlocal
goto eof

:help
echo LCD7 by Minecraft49. - Help
echo Syntax:
echo  LCD7 ^<digit^>
echo  LCD7 /?
echo  LCD7
echo.
echo Emulate a 7-segment digit display displaying specified digit.
echo Allowed digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (no hex digits)
:eof

Offline

Board footer

Powered by