Home    LBP Showcase / Reviews / Recommendations    Object Showcase
#1

Digital value functions

Archive: 5 posts


As an attempt to see if I actually could do this, I have created a serie of different digital value functions including a Digital-to-analog Converter and an Analog-to-digital Converter. All objects, but the displays are Microchips.

Full list over functions created:

Seven Segment Display (BCD)
Compare Display
Digital Comparator (Binary/BCD)
Digital Counter (BCD)
Digital Timer (BCD)
Digital-to-analog converter (BCD)
Analog-to-digital converter (BCD)


As you may see, most of the functions uses Binary Coded Decimal. This is to make them compatible with universal Seven Segment Displays, instead of one display per number needed.

Seven Segement Display
http://www.lbpcentral.com/forums/attachment.php?attachmentid=32032&d=1299785188
This object converts BCD-code to a viewable decimal number and is compatible with all my BCD based functions.
It have 4 inputs (+the activations input), each input represents a bit of BCD code. The inputs are A (+1/10/100, etc.), B (+2/20, etc.), C (+4/40, etc.) and D (+8/80, etc.). Do not mix values of different magnificence, like 4 and 20.

The range is 0-9 of any magnificence.

Digital Comparator (4-bit/8-bit/9-bit)
32038
This object is a universal comparator for digital values, and comes in three flavors based on your needs. The Comparator have six compare operations which are; Equal, More, Less, Unequal, More or Equal and Less or Equal each with its own output. The inputs are based on the versions you are using, but common is that it is made for comparing two values, so the first half of the inputs are for value 1 (main value) and the other half for value 2 (secondary value). The comparator is not limited to BCD-code, but do not mix input types, like using Binary as main and BCD as secondary.

Comparing Ranges (Binary/BCD):

4-bit: 0-15 / 0-9
8-bit: 0-255 / 0-99
9-bit: 0-511 / 0-100


Compare Display
http://www.lbpcentral.com/forums/attachment.php?attachmentid=32033&d=1299785887
Displays how two values are compared to each other. Can display any of the outputs from the Comparator. Only connect those inputs you want to use, as connecting everyone will just clutter up the display. Example is to connect Equal, Less and More to show if A=B, A>B or A<B, or connect Less and More or Equal to show if A<B or A>=B.

Digital Counter (4-bit/8-bit/9-bit BCD)
32036
This basically a counter like the built-in one, but this uses BCD-code as output, which means it always gives an output, not just when it have reached the needed value (combine with the Comparator if you want this). The counter have two inputs and outputs based on the version. The inputs are Count Up and Reset. Count up is bi-directional, which mean you can count both up and down, using a bi-direction signal. Every time Count up gets a signal, it counts up by one. The Reset input sets the counter to 0 when Reset gets a signal.

Counter Ranges:

4-bit: 0-19
8-bit: 0-99
9-bit: 0-100


Digital Timer (9-bit BCD)
32037
Works almost the same as the counter, except you keep it activated when want it to count (not pulse activated like the counter). May count both up and down with a bi-directional signal. The sampling time may be set in the microship, which means you can change how fast it counts. Default is +1 per second, but you may set it to as low as +1 per 0,1 second or make it slower like +1 per 10 second. The output is percentage of the sampling time x 100, represented by BCD. There is only one version of the timer.

Timer Range:

Range: 0-100%
Min: 0-10s
Max: 0-500000s (?)
Default: 0-100s


Digital-to-analog converter (9-bit BCD)
32034
This object converts BCD-code to an analog signal. The analog signal value = BCD value. The input is 9-bit BCD-code. The output is an analog signal. Conversion method used is activation of batteries inside of microchips and addition of analog values.

Range:

Input: 0-100
Output: 0-100%


Analog-to-digital converter (9-bit BCD)
32035
This object converts an analog signal to BCD-code. The BCD-code ≈ analog signal. The input is an analog signal. The output is 9-bit BCD-code. Conversion method used is a positional sequencer with batteries where the signals change.

Range:

Input: 0-100%
Output: 0-100


All functions are found on my level Useful functions (not built-in LBP2) (https://lbpcentral.lbp-hub.com/index.php?t=52516-Useful-functions-based-on-real-world-functions)
2011-03-10 17:28:00

Author:
MoareAI
Posts: 13


Q' ing this, it has some tools I need.2011-03-10 22:48:00

Author:
Hoplyte
Posts: 100


I grabbed these tools last night. You have a really good collection, plus they're properly annotated. Thanks.

My forum thread link https://lbpcentral.lbp-hub.com/index.php?t=49352-Sacknight-Fetch-Quest-of-the-King-(Funny-Medieval-Platformer)
2011-03-11 14:55:00

Author:
Hoplyte
Posts: 100


I always needed an accurate counter for my level, but I have to see it for myself, in the mean time try my SackSims level if your bored.

Try my sims level, it is now in version 1.6, with the interface in version 2.5.3

This is the forum thread https://lbpcentral.lbp-hub.com/index.php?t=50499-The-Sims-with-tutorial&p=787187#post787187

And this is the lbp.me page http://lbp.me/v/x48mnq*

Feedback will be great for more features.
2011-03-11 19:16:00

Author:
PerfectlyDarkTails
Posts: 269


@Hoplyte: Thanks for your feedback. Good to know that someone may find these useful, but me.

@ PerfectlyDarkTails: The counter in itself is 100% accurate and is tested throughly. But it is limited to the range of 0-100 and the output is BCD-code. With minor modifications it might not just be resettable, but also settable to any value you like. Give it a try and see if it meets your needs. (I might try your level later when I have time)
2011-03-11 23:04:00

Author:
MoareAI
Posts: 13


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.