[CentralOH] (no subject)

Andrew Fitzgerald andrewcfitzgerald at gmail.com
Sun Dec 8 17:34:57 CET 2013


Hi Lou,

Could you perhaps provide a summary of what that code is supposed to do?

Right now you're assigning num the numeric value 1.2346 on the first line.

You're then attempting to call num as a function on the next 2 lines.

This won't work because num hasn't been defined as a function anywhere, and
if it was the function is overwritten by the value 1.2346 on the first line.


The part below that (if/else) looks like it should work if a and b are
assigned numeric values.

-Andrew Fitzgerald


On Sun, Dec 8, 2013 at 11:09 AM, Louis Bogdan <looiebwv at gmail.com> wrote:

> Hi folks @central oh/python:
>
>
>
> As a recent subscriber, I received notice of your Dec 9 meeting from Brian.
> As I am working on a program to go along with a recently filed patent, and
> am totally new to Python, I sent him a proposed “subroutine”.  This is
> used repetitively within the program.  Since I sent it to Brian, I have
> done some more research and have come up with a better version as follows:
>
>
>
> num = 1.2346
>
> a = num(-1)
>
> b = num(-2)
>
> if a >7:
>
>      a = 0
>
>      b+ =1
>
> elif a<3:
>
>      a = 0
>
> else:
>
>       a = 5
>
>
>
> As each stepper motor step equals .0005” of movement, with the above I can
> get .0002” absolute positional accuracy with a .0005” control increment. I
> have looked at some of the Python “round” statements and examples and don’t
> fully understand them so as an “ole” retired engunear, (does 93 qualify me)
> I thunk up my own way of doing things.  Maybe some of you young ones can
> teach an ole man how to do things better.
>
>
>
> This routine also has application in several other projects I have under
> consideration. Would something like this, if it works, be a Python library
> item?
>
>
>
> If any of you can “tweek” the above into working order I would appreciate
> it.  I do have some other questions for you.  What do I need to buy to
> get started with RPi?  I will be using my Apple computer.
>
>
>
> Thank you for any comments you might have.  Lou Bigdan
>
>
>
>
>
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> https://mail.python.org/mailman/listinfo/centraloh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20131208/32cea0b6/attachment.html>


More information about the CentralOH mailing list