Shop OBEX P1 Docs P2 Docs Learn Events
Logic anc computation — Parallax Forums

Logic anc computation

RambomanRamboman Posts: 101
edited 2008-05-08 13:57 in Propeller 1
I bought the oled96 as a debug tool for my education kit, but being new in this business, I decided to play with the oled96 alone, for the moment.· A fantastic product!
My first project is Conway's Game of Life, I programmed 30 years ago on my Apple][noparse][[/noparse]
Discovering spin language, not far from Pascal, I have to come with some questions:
-· assignment: what happens if you assign a "long" to a "byte"?
-· logic: can I nest "if"s? I have got a mess with nested ifs, elseifs, elses...
-· more logic: if "cell" is 255(byte), is it a logical "true"?· not sure...
I got around with a "case" that seems to work.
I installed HyperTerminal on my Vista, but to be honest, debugging a stamp is much more easier...
Still remaining with a border bug on my Game of Life, unable to find why!
Should be able to trace...
Another: how to work with the microSD card on the oled96, I found no method for...
How to use oled96 as a debug terminal(serial) idem...
Thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-25 17:17
    1) If you assign a "long" to a "byte", the value gets truncated to 8 bits. If you assign a "long" to a "word" it gets truncated to 16 bits. All intermediate computations are done as 32 bit values.

    2) Yes, you can next IFs and any other control structure. You just indent them further. Each indent level is an additional nesting level. I suggest using 2 to 3 spaces as an indent.

    3) A zero value is false. A non-zero value is true as a logic value. If you do a comparison of something to the constant true, it has to be a 32 bit all ones value (-1). In other words, if you say "IF b" where b is any non-zero value, the IF will succeed. If you say "IF b == true", it will only succeed if b has the value $FFFFFFFF or -1.

    The microSD card works like other SD cards only using I/O pins 14-17 (CS,Clk,DO,DI). You can use uOLEDbasic from the Object Exchange or Rokicki's SD FAT file system driver from the Object Exchange with the I/O pin numbers changed.

    You'll need to write a program that receives characters using any of several serial I/O drivers, then displays the text on the uOLED display. You could use uOLEDbasic to do this. There are provisions for an "autostart" Basic program on the microSD card and Basic programs can read characters from the serial input line and then display them on the uOLED.
  • RaymanRayman Posts: 14,162
    edited 2008-04-25 18:39
    Do you have the uOLED-96-G1 or the uOled-96-Prop?

    If you have the 96-G1, you have to use 4Dsystems tools to access the SD card, it's not FAT formatted...

    If you have the 96-Prop, I (and possibly others) am working on a contest entry that should help you. It's due April 30...
    But, if you PM me, I'll send you what I have now in case you want to beta test it [noparse]:)[/noparse]
  • RambomanRamboman Posts: 101
    edited 2008-04-26 05:40
    Thank you all for such a fast response.
    It's the 96-Prop!
  • RambomanRamboman Posts: 101
    edited 2008-05-08 06:33
    YES !
    I would really appreciate to beta test it !
    Thanks
    ·
  • RaymanRayman Posts: 14,162
    edited 2008-05-08 12:25
    I've posted my serial driver to my web site here:

    There's a Windows application there too that can be used for testing the Oled functions...



    http://www.rayslogic.com/propeller/3rdPartyHardware/uOLED-96-Prop/RS232Driver.htm
  • RambomanRamboman Posts: 101
    edited 2008-05-08 13:57
    Thank you Rayman
Sign In or Register to comment.