Revision: 1288
Author: jsuijs
Date: Thu Sep 3 23:33:42 2009
Log: added space to seven_segment lib.
http://code.google.com/p/jallib/source/detail?r=1288
Modified:
/trunk/include/external/seven_segment/seven_segment.jal
/trunk/include/jal/lowpassfilter.jal
=======================================
--- /trunk/include/external/seven_segment/seven_segment.jal Thu Sep 3
00:46:45 2009
+++ /trunk/include/external/seven_segment/seven_segment.jal Thu Sep 3
23:33:42 2009
@@ -51,6 +51,7 @@
-- value 23 is character P
-- value 24 is character U_big
-- value 26 is character u
+-- value 27 is character space
-- --
-- Use:
-- --
@@ -280,9 +281,12 @@
_seven_common_mask ^ (
seven_segment_e
+ seven_segment_d
- + seven_segment_c )
-}
-
+ + seven_segment_c ),
+
+ -- value 27 is character space
+ _seven_common_mask ^ (
+ 0 )
+}
-- return seven segment value corresponding to lower nibble of x
function seven_from_digit( byte in x ) return byte is
=======================================
--- /trunk/include/jal/lowpassfilter.jal Sun Aug 9 11:24:50 2009
+++ /trunk/include/jal/lowpassfilter.jal Thu Sep 3 23:33:42 2009
@@ -5,18 +5,19 @@
-- This file is part of jallib (http://jallib.googlecode.com)
-- Released under the ZLIB license
(http://www.opensource.org/licenses/zlib-license.html)
--
--- Description: 1st and 2nd order low pass fitlers
+-- Description: 1st and 2nd order low pass filters
--
--
---------------------------------------------------------------------------
-- lpr_2nd_order
--
---------------------------------------------------------------------------
--- time_const = aantal bits dat naar rechts wordt geshift,
--- bijv 3 = delen door 8, 1 tau = 8
aanroepen.
--- u1 en u2 zijn hulpvars voor het tweede orde filter.
--- u1 is een maat voor de eerste afgeleide van de output.
--- u2 bevat de return-waarde << 16
--- Bug: bij input 0 kan output -1 (=65535) worden
+-- time_const = nr of bits that is shifted to the right
+-- ex: 3 = divide by 8, which takes 8 calls to achieve 1 tau
+-- (see http://en.wikipedia.org/wiki/Low-pass_filter for explanation of
tau)
+-- u1 and u2 are internal variables for the filter.
+-- (u1 is an indication of the first order of the output)
+-- (u2 contains the return-value << 16)
+-- Bug: with input 0, output can wrap around to -1 (=65535)
--
---------------------------------------------------------------------------
function lpf_2nd_order(sword in ui, sdword in out u1, sdword in out u2,
byte in time_const) return sword is
var sdword tmp
@@ -44,18 +45,20 @@
--
---------------------------------------------------------------------------
-- lpr_1st_order
--
---------------------------------------------------------------------------
+-- time_const = nr of bits that is shifted to the right
+-- ex: 3 = divide by 8, which takes 8 calls to achieve 1 tau
+-- (see http://en.wikipedia.org/wiki/Low-pass_filter for explanation of
tau)
+-- u1 is an are internal variables for the filter.
+-- (u1 contains the return-value << time_const)
--
---------------------------------------------------------------------------
function lpf_1st_order( sword in ui, sdword in out u1, byte in time_const)
return sword is
var sdword tmp
-; Result = Result - (Result / 64) + adc
-
u1 = u1 - (u1 >> time_const)
u1 = u1 + ui
; return (u2 + 32768) / 65536 tmp = u2
tmp = u1
-;; tmp = tmp + 32768 ; juist afronden
tmp = tmp >> time_const
return sword(tmp)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---