Shop OBEX P1 Docs P2 Docs Learn Events
New to group: Intro and a Question — Parallax Forums

New to group: Intro and a Question

ArchiverArchiver Posts: 46,084
edited 2001-03-29 02:15 in General Discussion
Scott-

1.8 * 256 = 460 (and change) = 1CC hexadecimal = $01CC

Sounds like you have a handle on the rest. If not, ask some more.

Sure is refreshing to see a question that reflects substantial, prior
effort and study on the part of the questioner. Re the TRS-80, my
Model I is still my favorite and still running fine. I understand
there are computers available now with more speed and memory. But
programming principles haven't changed much.

Welcome to the list/"group". You'll find some good help and good
people here.


Regards,

Steve

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-03-28 21:24
    Hi all

    My name is Scott and I am new to stamp programming. I recieved my kit a
    few days ago and have been very busy learning. I have been lurking here
    and reading up on posts. I am realizing I have a lot to learn.

    It has been many years since I have done any coding at all...RS TRS-80
    days. But it is slowly coming back.

    I don't have any specific applications in mind yet for my stamp, It
    just looked interesting and I love new challenges.

    I'm having some trouble with the */ operator and understanding how it is
    used to scale the output of the RC circuit. I think my problem is not
    the scaling factor(I understand normalization) but the conversion from
    decimal to hex and what is actually happening with the math on the stamp

    For example (from Experiment #28 in Stampworks 1.1):

    TempIn = TempIn */ $01CC 'multiply by 1.8

    How does $01CC = 1.8 ??


    To the regulars:
    I'm sorry if this is repetitive newbie stuff......If so please point me
    in the right direction.

    Thanks
    Scott
    --
    ***********************************************************************
    * "They that will sacrifice liberty in exchange for temporary safety *
    * deserve neither liberty or safety." *
    *
    B. Franklin
    *
    ***********************************************************************
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-29 01:04
    The */ operator is tricky IMHO. Tracy Allen has a good discussion at

    http://www.emesystems.com/BS2math1.htm#top

    It is much clearer than the Stamp Manual.

    Ray McArthur

    Original Message
    From: Scott <sknutson@l...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, March 28, 2001 3:24 PM
    Subject: [noparse][[/noparse]basicstamps] New to group: Intro and a Question


    > I'm having some trouble with the */ operator and understanding how it is
    > used to scale the output of the RC circuit. I think my problem is not
    > the scaling factor(I understand normalization) but the conversion from
    > decimal to hex and what is actually happening with the math on the stamp
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-29 02:15
    [font=arial,helvetica]In a message dated 3/28/01 4:22:56 PM Central Standard Time,
    sknutson@localaccess.com writes:


    How does $01CC = 1.8 ??


    The */ (star-slash) is a bit tricky at first, but not really that tough. ·The
    upper byte is the whole value (1 in the example above) and the lower byte is
    the fractional value, expressed in 1/256 increments.

    $CC = 204 ... 204 / 256 = 0.796

    To go the other way, take your fractional value, multiply it by 256, then
    convert to HEX to put it in the form shown above. If you want to multiply by
    10.3, for example, you would use $0A4D.

    10 --> $0A
    0.3 * 256 = 76.8 ... 77 --> $4D

    If you go back, the value $0A4D = 10.30078125 (pretty close to 10.3)

    There may, at times, be slight rounding errors. ·Tracy Allen has a very good
    write-up on this subject if you need a lot of accuracy.

    -- Jon Williams
    -- Dallas, TX





    [/font]
Sign In or Register to comment.