Menu

Wish-list item

YT2095
2012-03-07
2013-09-22
  • YT2095

    YT2095 - 2012-03-07

    I`m not sure if GCBASIC is even supported anymore, but on the off chance it is, I`d like to see a RND (Random) function added to the maths side of things.
    This would be Very usefull for anything from White noise generators to LED christmas tree light strings.
    I`v seen it used in the PIC chip DICE rolling program, so it is possible to do, but having it as a seperate module (command or library) that you could call would be great.

    just a thought ;)

     
  • Hugh Considine

    Hugh Considine - 2012-03-07

    GCBASIC is still supported, it's just other distractions have been taking away time lately. There's a random function in there already, called Random. It will give you a pseudo random number between 0 and 255 inclusive.

    One thing you need to be careful of: Random will give the same sequence of numbers every time, unless you use Randomize to change the seed. You need to give Randomize a number that will change every time the program runs - a sensor value is the best thing to use. For example, if you have a light sensor attached to analog input 1, you can set up the random number generator with this line:

    Randomize ReadAD(AN1)

    Hope that helps!

     
  • YT2095

    YT2095 - 2012-03-07

    that`s great news (on both counts).
    and while you`re here I just want to say Thank You for making this program! I have nearly 200 old PIC chips here and manuals that are less than helpful, and after stumbling across this place, I was able to make use of these chips very quickly, after a Month of trying it the hard way, the chips I have are 16c5x series and don`t have any analog type pins.
    which brings me to my other point about the Random function, I`v looked everywhere I can think of for it, here: http://gcbasic.sourceforge.net/help/  there`s nothing I can see, and in the actual program help files itself, there`s nothing on Random either?
    I`m guessing now that I`m not looking in the right places, or have out-of-date s/ware?
    can you show me where these files are please, I don`t like asking silly questions or wasting folks time on threads such as this, so sorry about that!
    as for the number sequence being the same, it`s not really too much of an issue for Christmas type lights or white noise generators anyway, the eye and ear would hardly detect it anyway ;)
    at worst I could leave port A floating, and read the 4 bit number from that as a seed, it always seems to give random effects anyway if not pulled high or low.

    thanks again for your time and help And for a great program!, I have recommended this to a few friends already on Twitter, and plan on doing a quick write-up on my Element 14 blog.

    all the best!

     
  • Santiago

    Santiago - 2012-03-08

    Hi yt2095.

    You can have a look to this help page: http://gcbasic.sourceforge.net/newfiles/help/

     
  • YT2095

    YT2095 - 2012-03-08

    Cheers! I`v just bookmarked that in preference to the original link I had, Now Ican see the Random function in there along with other goodies :)
    I also DL`d GCIDE last night as well, I think it`s V3, it looks totally different the graphical Flow-Chart type that I`m using now.
    it does so many different types of chip, all in the same lang, I`m considering using GCB in preference to C variants such as arduino or MPIDE.

     
  • ofuzzy1

    ofuzzy1 - 2013-09-21

    Could you please update the
    Great Cow BASIC Help File:
    http://gcbasic.sourceforge.net/support.html

    to point to: http://gcbasic.sourceforge.net/newfiles/help/

    This is really important because without the added features your product looks 'wanting' And is most certainly not.

    --- Thanks for all your most excellent work!

    Any chance on a "compiled" version of this for local use?
    --worse case I'll just httrack and vacuum the whole section

     

    Last edit: ofuzzy1 2013-09-21
  • Hugh Considine

    Hugh Considine - 2013-09-22

    New link added, there certainly have been a lot of changes since 2007! There should be a compiled version (gcbasic.chm) included with every update.

     

Log in to post a comment.