-- -- name : e0002.jal -- author : Wouter van Ooijen -- date : 05-May-1998 -- purpose : jal example -- -- This program shows a night-rider style LED on port B -- -- target configuration: 16f84 with 10 Mhz Xtal include 16f84_10 -- standard library include jlib -- jal has no enumerate, so use constants const byte to_right = 1 const byte to_left = 0 -- determine a new direction d when x has hit a boundary, -- shift x one step in the good direction procedure night( byte in out x, byte in out direction ) is -- hit left border? if ( x & 0b_1000_0000 ) != 0 then direction = to_right end if -- hit right border? if ( x & 0b_0000_0001 ) != 0 then direction = to_left end if -- shift in current direction if direction == to_right then x = x >> 1 else x = x << 1 end if end procedure -- port b all pins output port_b_direction = all_output var byte x = 0b_0000_0001 var byte d = to_left -- main loop forever loop -- set port b -- for active-low LEDs remove the -- port_b = x -- ^ 0xFF -- delay 200mS delay_100ms( 2 ) -- shift x one step in the current direction night( x, d ) end loop
file: /Techref/microchip/language/jal/doc/e0002.jal, 1KB, , updated: 1998/12/23 14:17, local time: 2024/8/14 19:35,
13.59.172.11:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://piclist.com/techref/microchip/language/jal/doc/e0002.jal"> microchip language jal doc e0002</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to piclist.com! |
.