PDA

View Full Version : Logic anc computation

Ramboman
04-25-2008, 11:48 PM
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][
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

Mike Green
04-26-2008, 12:17 AM
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.

Rayman
04-26-2008, 01:39 AM
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 :)

Ramboman
04-26-2008, 12:40 PM
Thank you all for such a fast response.
It's the 96-Prop!

Ramboman
05-08-2008, 01:33 PM
YES !
I would really appreciate to beta test it !
Thanks
·

Rayman
05-08-2008, 07:25 PM
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

Ramboman
05-08-2008, 08:57 PM
Thank you Rayman