Revision: 1212
Author: jsuijs
Date: Mon Aug 17 01:35:57 2009
Log: jseven test
http://code.google.com/p/jallib/source/detail?r=1212

Added:
  /trunk/test/external/jseven
  /trunk/test/external/jseven/test_jseven.jal
Modified:
  /trunk/test/board/board_16f877a_dwarf.jal

=======================================
--- /dev/null
+++ /trunk/test/external/jseven/test_jseven.jal Mon Aug 17 01:35:57 2009
@@ -0,0 +1,50 @@
+-- ------------------------------------------------------
+-- Title: Test program for jseven (seven segment display
+--
+-- Author: Joep Suijs, Copyright (c) 2009..2009, all rights reserved.
+--
+-- Adapted-by:
+--
+-- Compiler: >=2.4g
+--
+-- This file is part of jallib (http://jallib.googlecode.com)
+-- Released under the BSD license  
(http://www.opensource.org/licenses/bsd-license.php)
+--
+-- Description: Testing lcd_backlight
+-- --
+-- This file defines a test for JALLIB testing, using a test-board
+--  defined by a BOARD file .
+--
+-- Sources:
+--
+-- Notes:
+-- setup:   A seven segment display connected to a port
+--
+-- ------------------------------------------------------
+
+;@jallib use chipdef
+
+enable_digital_io() -- disable analog I/O (if any)
+
+include delay
+
+;@jallib use jseven
+include jseven
+
+portd_direction = all_output
+
+
+var byte i = 0
+forever loop
+
+   -- set backlight off for two seconds
+   portd = seven_from_digit(i) -- display char
+   delay_1ms(500)
+
+   i = i + 1
+   if (i > 17) then
+      i = 0
+   end if
+
+
+end loop
=======================================
--- /trunk/test/board/board_16f877a_dwarf.jal   Sun Aug 16 16:42:16 2009
+++ /trunk/test/board/board_16f877a_dwarf.jal   Mon Aug 17 01:35:57 2009
@@ -88,3 +88,13 @@
  alias keydrive is portb_low      -- columns of keyboard
  alias keydrive_direction is portb_low_direction

+;@jallib section jseven
+-- constant for the segments      gfe dcba
+const byte seven_segment_a  = 0b_0000_0001
+const byte seven_segment_b  = 0b_0000_0010
+const byte seven_segment_c  = 0b_0000_0100
+const byte seven_segment_d  = 0b_0000_1000
+const byte seven_segment_e  = 0b_0001_0000
+const byte seven_segment_f  = 0b_0010_0000
+const byte seven_segment_g  = 0b_0100_0000
+const byte seven_segment_dp = 0b_1000_0000

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to