このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


Pascalite 金物類/武器類: How to Use It HOME - - - - - - - - - Other 構成要素 for programmers - - - - - - - - - Pascalite Tutorial (米)棚上げする/(英)提議する of Contents

Pascalite 金物類/武器類: How to Use It


This is not finished... you'll soon see that! However, while I apologise for typos, bad phrasing, etc, I still think this is something *I* would want as an 援助(する) if I had a new Pascalite I 手配中の,お尋ね者 to get to 支配するs with. Decide for yourself!

Getting started with Pascalite

I wrote this tutorial to help 使用者s quickly master the さまざまな features of the Pascalite.


If you have just received your Contol 加える Pascalite, and want....

to get it unpacked and 始める,決める up....

with 極小の fuss....

and 最大限 chance of 避けるing 損失ing mistakes...

.... then I 示唆する you visit....

        Pascalite: First Steps. Besides helping you 始める,決める things up, it shows you how to attach an LED and 現在の 限界ing resistor so you can see 生産(高), and how to attach a switch and pull-up resistor so you have an input.


This 構成要素 (c) T K Boyd, 3/03. I hope you will 設立する links to this for me... but please do not re-分配する it. It is for your personal use. If you are a teacher, please feel 解放する/自由な to make 適切に credited copies for use by your own pupils until August 2004, at which time the license lapses. Please revisit this 場所/位置 to see how things stand then.


This is written 特に for the Pascalite 加える, and ソフトウェア 見解/翻訳/版 2.60C... but much of what appears here will 適用する 平等に to the other Pascalites and other 見解/翻訳/版s of the ソフトウェア.

I 嫌疑者,容疑者/疑う most 使用者s will already have the ソフトウェア 任命する/導入するd, but if you want help with that, see First Steps.

I have tried to cover things that neophytes will need to know. Let me know if you were left without an answer to something. Experienced 使用者s: Please be 患者?!

I have no formal 関係 to 支配(する)/統制する 加える, though I hope, through this and other 成果/努力s to build up some "good will" credit with them!

====
I have (at least!) two other pages relating to the Pascalite. The first is essentially "advertising"... something to tempt you に向かって the fun I've been having. (That page also 会談 about the BASICStamp and at least one 代案/選択肢 PIC compiler.) The other page has general tutorials on Pascal programming, but they are written to run without modification within the 解放する/自由な Pascalite 環境. You don't need the Pascalite 金物類/武器類 to work through the tutorials.

Why you want a Pascalite (or BASICStamp) This is probably a better place to start if you don't have a Pascalite, unless you are 特に 利益/興味d in the 金物類/武器類 面s, in which 事例/患者 the 詳細(に述べる)s below of how to 接近 さまざまな features of the splendid Pascalite may be what you want.

Pascal Programming- using a 解放する/自由な compiler.

====
Jump to the 底(に届く) of the page if you want to run without bothering to walk first. There are links to more 前進するd topics.

====
The に引き続いて assume you've got your Pascalite 始める,決める up and have 首尾よく made a few very simple 実験(する)s. (Lit an LED on d0, 実験(する)d an input on d4. If you need help, see First Steps.) The に引き続いて hopes to take you through more 演習s and 実験(する)s which will...

     a) その上の introduce you to your Pascalite
     b) 実験(する) it in a 論理(学)の and "first things first" sequence.

=======
Now... if you have the LCD module... and it is working.. you can skip the に引き続いて, but I think it is better to 令状 this introduction so that as many people can use it as possible, and so that one thing can be 実験(する)d at a time.....

Connect three more LEDs, each with a resistor, to d1, d2, and d3.

NB: The pages in the 手動式の giving which-pins-connect-to-what-signal are 平易な to 混乱させる, and the 関係s for a Pascalite プロの/賛成の are NOT the same as for a 加える.

Enter the に引き続いて program:

program IntTut3;
var bCnt:byte;
begin
def_out(d0,d1,d2,d3);
repeat
for bCnt:=0 to 15 do begin
  令状(portd,bCnt);
  延期する(200);
  end;
until 4=5;
end.
You should see 0, 1, 2, 3... 13, 14, 15, 0, 1, 2... appearing on the LEDs in binary. 限られた/立憲的な 生産(高)... but 適する to give a 予選 実験(する) of many things. Of course, you have to be able to read binary numbers to "fully" use this "生産(高) 装置"... but don't worry if you can't. ("When I was a boy", I spent many hours feeding binary numbers into a PDP-8 with mechanical switches. Not a lot of fun, and programs take a while to develop, but it did teach me binary!)

========
Now we're going to 修正する the previous program so that if you DO have the LCD module, it too will be 陳列する,発揮するing 0, 1, 2, 3...

Plug the module in CAREFULLY: You don't want the I2C connector 回転/交替d from it's 訂正する orientation.

program IntTut3b;
var bCnt,bNum:byte;
begin
def_out(d0,d1,d2,d3);
repeat
for bCnt:=0 to 9 do begin
  令状(portd,bCnt);
  bNum:=bCnt+48;
  令状(LCD,bNum);
  令状(LCD,"  ");{two spaces}
  延期する(200);
  end;
until 4=5;
end.
You should see 0, 1, 2, 3... 8, 9, 0, 1, 2... in the upper left of the LCD 陳列する,発揮する.

The tiresome stuff about +48 arises to translate from a number to the code for a digit.

You should see digits printing across the LCD. Change the number of spaces in the WRITE(LCD," "); line for amusing 影響s.

=========
修正する the previous program as follows:
program IntTut3c;
var bCnt,bNum,bIn:byte;
begin
def_out(d0,d1,d2,d3);
令状(LCD,255);{(疑いを)晴らすs LCD}
repeat
for bCnt:=0 to 9 do begin
  令状(portd,bCnt);
  bNum:=bCnt+48;
  gotoxy(0,0);
  令状(LCD,bNum);
  令状(LCD,"  ");{two spaces}
  延期する(200);
  repeat
    read(portd,bIn);
  until (bIn and 16)=16;{This line optional}
  end;
until 4=5;
end.
This just tidies a few things, shows you how others are 遂行するd. The optional line will 許す a switch on input d4 to pause the 宙返り飛行ing through the numbers... if you still have the switch from program IntTut2.pas 大(公)使館員d.

This program is 貧しく designed: It can "落ちる over" if bNum 持つ/拘留するs something other than 0 to 9 before 48 is 追加するd to it. The next program 取引,協定s with that problem.

A minor pity: You can only put numbers after GotoXY. You can't put variables in their place. That seems a pity, at first, but with the sort of 陳列する,発揮するs we have, it really isn't a problem.

=========
It is time to use a 手続き. In essence, this is a way to (不足などを)補う new words for the language. Don't be alarmed at the "large" (親族 to what we've done so far) chunk of code 追加するd. Once it is working, you only have to think about "NumToLCD" any time you want to send a NUMber TO the LCD to be 陳列する,発揮するd. (This "big" program only uses 6% of the space in an 8k Pascalite.)

For those who've done some programming before: A little 失望: The compiler does not 許す variable 指名するs to be re-used for 地元の variables. In other words, in the に引き続いて program, as bNum is 宣言するd as a 全世界の variable, you cannot have another bNum within the 手続き NumToLCD.

修正する the previous program to create....

program IntTut4;
{Be careful not to 挿入する extra 半分-結腸s in this}
var bCnt,bNum:byte;

手続き NumToLCD(bDisp:byte);
{It must be possible to do a better 職業, but
 this does work!}
var bTens,bTmp2,bTmp:byte;
begin
gotoxy(0,0);{It appears that the parameters of GOTOXY cannot be variables.}
令状(LCD,"   ");{3 spaces}
gotoxy(0,0);
if bDisp>199 then begin
  令状(LCD,"2");
  bDisp:=bDisp-200;
  end {was>199} else
    if bDisp>99 then begin
      令状(LCD,"1");
      bDisp:=bDisp-100;
      end {was >99} else 令状(LCD," ");
{100's digit now done}
bTens:=bDisp DIV 10;
bTmp2:=bTens*10;
bTmp:=bDisp-bTmp2;
bTens:=bTens+48;
令状(LCD,bTens);
bDisp:=bDisp-bTmp2;
{10's digit now done}
bDisp:=bDisp+48;
令状(LCD,bDisp);{And finally: 令状 部隊s digit}
end; {of 手続き}

begin
def_out(d0,d1,d2,d3);
令状(LCD,255); {(疑いを)晴らすs LCD}
repeat
for bCnt:=0 to 255 do begin
  令状(portd,bCnt);
  NumToLCD(bCnt);
  延期する(90);
  end;
until 4=5;
end.
You should see now see the Pascalite counting from 0 to 255, and then starting again endlessly. Sorry: The program prints 主要な 0s when printing 0-9.

========
Now that we have a way to show the outside world what's inside the Pascalite... onward! To keep this (警察などへの)密告,告訴(状) digestible, I've 分裂(する) some 構成要素 off の上に their own pages...

(You can show numbers on the LCD if you have one, but the に引き続いて programs will also send at least part of every number to the four LEDs for those of you without an LCD 陳列する,発揮する.)

Pascalite 反対する: A useful feature: counts things happening even when your program isn't "looking".

Pascalite Real Time Clock: So what's "unreal" time? RTCs give you the date and time of day.

Some Like It Hot: 手段ing 気温s

RS-232: Serial communications: first program- 送信する/伝染させる RS232

RS-232: Serial communications: More 前進するd- receive RS232

Analog to 数字表示式の 転換 監視するing 非,不,無-数字表示式の signals



Sorry folks! That's it for now. I'll try to get 支援する to it, tidy it up. General feedback welcome. Don't worry (yet) about telling me about 孤立するd typos. If you find anything 現実に WRONG, please DO let me know so I can 少しのd it out, hoping to get it gone before some poor neophyte wastes time struggling.....


To search THIS 場所/位置.... (Go to the 場所/位置's above, and use their search buttons if you want to seach them.)... Way to search this 場所/位置 without using forms
Search this 場所/位置 or the web 力/強力にするd by FreeFind

場所/位置 search Web search

広告 from page's editor: Yes.. I do enjoy 収集するing these things for you... hope they are helpful. However.. this doesn't 支払う/賃金 my 法案s!!! If you find this stuff useful, (and you run an MS-DOS or Windows pc) please visit my freeware and shareware page, download something, and 循環させる it for me? Links on your page to this page would also be 高く評価する/(相場などが)上がるd!
Click here to visit editor's freeware, shareware page.

Link to editor's (Arunet) homepage
How to email or 令状 this page's editor, Tom Boyd