Hi Bill,

I’d go for a table driven approach.

The table has 30 values (or perhaps 15, for one quadrant of your clock face) 
and the function
is called 3852 times with a parameter 0-3852 and compared against the table to 
decide which
led is to be activated.

The table can be calculated with a spreadsheet. Just do some experiments with a 
spreadsheet,
until you get that eureka feeling. Then transfer the values to your PIC code, 
putting them in a 
nested if-then-else scheme to compare against the 30 or 15 values. It does not 
take more than
6  compares (maximum) to find the answer.

I would not use the PIC to do time consuming floating point math. A 
precalculated table makes
more sense here.

Cheers, Frank


From: Bill van Dijk 
Sent: Saturday, February 22, 2014 5:43 PM
To: neonixie-l@googlegroups.com 
Subject: RE: [neonixie-l] Math wizzards....

Yes, I am with you so far. My challenge is to actually put that knowledge to 
work, and find the correct numbers.

 

Cheers, Bill

 

From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On 
Behalf Of Tidak Ada
Sent: Saturday, February 22, 2014 11:03 AM
To: neonixie-l@googlegroups.com
Subject: RE: [neonixie-l] Math wizzards....

 

Remember the swing velocity is a (co)sine function. The highest speed is in the 
zero crossing the tops are the left and right ends of the swing with a speed 
zero.

 

eric

 


--------------------------------------------------------------------------------

From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On 
Behalf Of Bill van Dijk
Sent: zaterdag 22 februari 2014 16:31
To: neonixie-l@googlegroups.com
Subject: [neonixie-l] Math wizzards....

Hello,

 

I have built a clock controlled by a PIC with 6 numitrons in the centre. Around 
them is a circle of 60LEDs which are programmed to display a number of 
different patterns. I am currently working on a pendulum pattern which uses the 
lower 30 LEDs. I have the software done, the challenge is this:

 

A pendulum has a period and an angular velocity that changes from 0 at the 
ends, and maximum in the center, following an equation. In the software I 
currently have 36 time slices (program steps, 0 to 35) in a half period of 107 
clock cycles, for a total of 3852 cycles for one swing (left or right). 

 

Looking at one swing, my challenge now is to divide the 36 program steps of 107 
clock cycles such that the total number of clock cycles remains 3852, but the 
actual number of clock cycles per step are divided such as to approximate the 
equation of one pendulum swing  (left or right). 

 

Anyone willing to take a stab at this?

 

Bill van Dijk

-- 
You received this message because you are subscribed to the Google Groups 
"neonixie-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neonixie-l+unsubscr...@googlegroups.com.
To post to this group, send an email to neonixie-l@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/neonixie-l/002101cf2fe3%242ae9c9c0%2480bd5d40%24%40com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"neonixie-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neonixie-l+unsubscr...@googlegroups.com.
To post to this group, send an email to neonixie-l@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/neonixie-l/!%26!AAAAAAAAAAAYAAAAAAAAAPDddShx705MuX20yCpp0vvCgAAAEAAAAPGcVbt7i2JNk%2B0ud8ipvKsBAAAAAA%3D%3D%40zeelandnet.nl.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"neonixie-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neonixie-l+unsubscr...@googlegroups.com.
To post to this group, send an email to neonixie-l@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/neonixie-l/002d01cf2fed%2452113dd0%24f633b970%24%40com.
For more options, visit https://groups.google.com/groups/opt_out.


---
Dit e-mailbericht bevat geen virussen en malware omdat avast! 
Antivirus-bescherming actief is.
http://www.avast.com

-- 
You received this message because you are subscribed to the Google Groups 
"neonixie-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neonixie-l+unsubscr...@googlegroups.com.
To post to this group, send an email to neonixie-l@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/neonixie-l/66AE152FD6994EB98E6054A1225E6255%40FrankPC2012.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to