Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

How to store the output signal value of a sensor

Archive: 12 posts


Anyone know how I can store the analogue value output by a sensor to use at a later point?

Essentially I am trying to snapshot the signal strength of a tag sensor when a button is pressed and reuse that value when another button is pressed.

Thanks
2011-02-08 20:35:00

Author:
Unknown User


Take a look at rtm223's blog entry here: Analogue Logic 4 - Basics of Sampling & Scaling (http://www.lbpcentral.com/forums/entry.php?2325-Analogue-Logic-4-Basics-of-Sampling-amp-Scaling)

Under: OR Gate Samplers

That might be what you are looking for.
2011-02-08 21:05:00

Author:
Osprey71
Posts: 93


Excellent!
Thanks!
2011-02-08 21:05:00

Author:
Unknown User


Of course, it looks like if you want to re-store a lower value you will have to modify the circuit to clear out the value that feeds back into the OR Gate.

Never-mind, the pictured circuit already does that, I was fixating on the paragraphs above the picture.
2011-02-08 21:11:00

Author:
Osprey71
Posts: 93


Of course, it looks like if you want to re-store a lower value you will have to modify the circuit to clear out the value that feeds back into the OR Gate.

Never-mind, the pictured circuit already does that, I was fixating on the paragraphs above the picture.

Actually, having seen you post this, I realised that I never rechecked that circuit works with the newer builds of the logic, and then when I went to look at it... it's wrong. The NOT gate is in the wrong place! It should be feeding into the bottom AND gate and the counter should be feeding directly into the top AND gate.

I'll get that fixed up asap
2011-02-08 21:24:00

Author:
rtm223
Posts: 6497


Actually, having seen you post this, I realised that I never rechecked that circuit works with the newer builds of the logic, and then when I went to look at it... it's wrong. The NOT gate is in the wrong place! It should be feeding into the bottom AND gate and the counter should be feeding directly into the top AND gate.

I'll get that fixed up asap

You know, I thought that looked funny. I just figured you knew what you were doing so I wouldn't question it Plus I'm at work and don't have access to LBP to test it out. Those blog entries are brilliant BTW, I refer to them a lot even though I haven't had a use for most of that stuff yet.
2011-02-08 21:32:00

Author:
Osprey71
Posts: 93


Actually, having seen you post this, I realised that I never rechecked that circuit works with the newer builds of the logic, and then when I went to look at it... it's wrong. The NOT gate is in the wrong place! It should be feeding into the bottom AND gate and the counter should be feeding directly into the top AND gate.

I'll get that fixed up asap

So that's why I couldn't get it to work. I had just figured things changed between the beta and gold versions. BTW, RTM, does the sampler just store the magnitude of the signal? Wondering because it's fed through that first AND gate and I can't seem to get AND gates to retain the sign of the analog signal.
2011-02-08 21:40:00

Author:
Shanghaidilly
Posts: 153


It can, but it goes funky and is unreliable. You can split the signal, use two of these, and recombine, if you need signed analogue and digital values

Worth noting that it does save all 3 of analogue, digital and player data, though you may have to ensure that the trigger signal is cleansed of player data before you input it, else you will pick up player data from the trigger signal, potentially. It updates instantly as well, which is possibly a good thing and possibly not.
2011-02-08 21:51:00

Author:
rtm223
Posts: 6497


It can, but it goes funky and is unreliable. You can split the signal, use two of these, and recombine, if you need signed analogue and digital values

Worth noting that it does save all 3 of analogue, digital and player data, though you may have to ensure that the trigger signal is cleansed of player data before you input it, else you will pick up player data from the trigger signal, potentially. It updates instantly as well, which is possibly a good thing and possibly not.

I went a different approach with my memory circuit since it doesn't use a pulse generator (well it does, but it only generates one frame of on then it's off). The trigger is completely isolated from the stored value, so it doesn't infect the input as you mentioned. Also, my input doesn't go through an AND gate prior to the OR circuit loop, so it retains all the values including the sign of the analog input.

Both methods, yours and mine have pros and cons, with the downside of mine is that it doesn't instantly update (has one additional frame of latency), and the output signal drops to zero for one frame while it is being stored. I believe it stores all three components, but I haven't tested for player data (and quite frankly don't know how).
2011-02-08 22:00:00

Author:
Shanghaidilly
Posts: 153


The NOT gate is in the wrong place! It should be feeding into the bottom AND gate and the counter should be feeding directly into the top AND gate.

I'll get that fixed up asap

So, if I'm clear, should the counter still be also feeding into the NOT gate as well as the top AND gate?
2011-02-09 00:17:00

Author:
Unknown User


Yes, think you just have to swap the NOT gate to the lower AND gate, so the upper AND gate is the value straight from the counter and the lower one is the counter through the NOT gate.

Considering that it works at all, his testing was from the beta.
2011-02-09 01:46:00

Author:
Osprey71
Posts: 93


Yeah that's the correct layout. I did retest briefly last night but forgot to bring images across. Initial testing suggests it still works 2011-02-09 08:09:00

Author:
rtm223
Posts: 6497


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.