November 24, 2024, 11:09:34 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Why not BS2 in a prop1

Started by grimshady, June 14, 2007, 08:34:51 PM

Previous topic - Next topic

grimshady

This may seem like a stupid question but would it be possible (and just marginally more expensive) to stick a BS2 processor on a prop1 board (somewhat modified)?   I know the bs2 supports more I/O lines and other functions  but I would give those up just to be able to use the higher level commands of the bs2 when coding for the prop1.

Coding for the BS1 is painful for me but I hate to pay the price for the prop-2.

Just a thought, IS the BS2 chip what makes the prop2 100 bucks or is it the extra supporting hardware?   I would pay 10 more bucks for a prop1 with a bs2 in it?  Dont shoot me, I'm just wondering if it was considered (or even practical)?

JonnyMac

June 14, 2007, 09:02:18 PM #1 Last Edit: June 14, 2007, 09:09:56 PM by JonnyMac
Not practical; there is more than just the chip and the Prop-1 board size would not support the required components -- and it certainly wouldn't be just $10 more; in our minds the Prop-1 is worth $60 (compare our prices to other controller vendors) but we decided not to raise the price when we separated from Parallax so we wouldn't upset our existing customer base. 

Let me suggest that PBASIC 1 is painful for you because you insist that it is.  Try this... tell yourself, "If that yutz, Jon Williams, can do this stuff then it MUST be easy and I can do it all day long."  Remember what Henry Ford said: "Whether you think that you can, or that you can't, you are usually right."  I'm betting that if you start thinking that programming the Prop-1 is easy, it will quickly become just that.  Please don't shoot me.

Just a reminder: if you get stuck programming the Prop-1 I'm always here to help; nearly 7 days a week, about 16 hours a day -- I may live in Hollywood but I tend stick close to home most days so that I can help when I'm needed.
Jon McPhalen
EFX-TEK Hollywood Office

grimshady

OK, fair enough.  I have written code for the prop-1 but found it cumbersome not to have and if then and for next loops.
I had to implement them myslef using up valuable code space.

That said,  I need a few more prop-1's.  I haven't seen a group buy lately on any of the halloween lists?   

Is that a thing of the past or is EFX-TEK open to that sort of thing?

JonnyMac

Yes, IF-THEN on the BS1 is the trickiest -- because it works just like the underlying processor:

  IF some_condition_is_true THEN go_somewhere

This is called "test and branch."  In "modern" IF-THEN-ELSE constructs we're used to having a "THEN" section and an "ELSE" section -- we have to do it like this in PBASIC 1:

IF condition_is_false THEN Else_1

  ' then section
  GOTO EndIf_1

Else_1:

  ' else section

Endif_1:


Note that what we're testing for is the opposite of the condition.  (Secret: This is what the PBASIC 2.5 compiler generates when you use IF-THEN-ELSE with the Prop-2 -- it all happens "under the hood")


FOR-NEXT is available; the only thing you have to do is specify a negative STEP size if going backward:

  FOR thePin = 0 TO 6
    HIGH thePin
    PAUSE 1000
    LOW thePin
  NEXT

  FOR thePin = 7 TO 1 STEP -1
    HIGH thePin
    PAUSE 1000
    LOW thePin
  NEXT



What PBASIC 1 doesn't have is DO-LOOP, but that can be [manually] coded like this:

  DO WHILE condition
  LOOP

would translate to:

Loop_1:
  IF condition_is_false THEN EndLoop_1
    ' loop statements
EndLoop_1:



  DO UNTIL condition
  LOOP

would translate to:

Loop_1:
  IF condition_is_true THEN EndLoop_1
    ' loop statements
EndLoop_1:


 
  DO
  LOOP WHILE condition

would translate to:

Loop_1:
  ' loop statements
  IF condition_is_true THEN Loop_1



  DO
  LOOP UNTIL condition

would translate to:

Loop_1:
  ' loop statements
  IF condition_is_false THEN Loop_1



So you see, you can in fact do anything that PBASIC 2.5 does (as far as programming structures), you'll just do it differently.  Secret: When we created PBASIC 2.5 we had to map all these things out because the interpreter is designed around PBASIC 2.0; so the 2.5 tokenizer creates code structures like I've illustrated above.  Hopefully you can use these examples to get what you want from your Prop-1 programs. 


We don't organize group buys, we just fulfill them -- we have the same published discounts as always, and anyone is free to take advantage of them.
Jon McPhalen
EFX-TEK Hollywood Office

grimshady

You know, I misspoke.  Its been a while since I wrote my one application for the bS1 and I forgot it does have "for/next" and 'IF/THEN"

I recall now it was the IF/THEN/ELSE that I missed the most.  Having to implement the alternative branches and then returns to the correct place for the continued execution.

I'll go look at the quantity pricing and see if anyone wants to "group it up"