Has anyone tried AI with PICBASIC


+ Reply to Thread
Results 1 to 40 of 104

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645

    Default Re: Has anyone tried AI with PICBASIC

    just spotted this gem on the arduino forum

    you need to know better than the AI in order to know that the solution offered by the AI is wrong
    Warning I'm not a teacher

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133

    Default Re: Has anyone tried AI with PICBASIC

    It makes perfectly sense!

    One cannot blindly trust the machine. The replies depend very much on the prompt anyway. So, if you do not how to ask or what to ask, then you cannot expect magic to happen, right?

    Ioannis

  3. #3
    Join Date
    Feb 2013
    Posts
    1,124

    Default Re: Has anyone tried AI with PICBASIC

    I would say, that for relatively simple coding routines, PBP knowledge of AI had been improved, but just when you ask something more complex, you'll get this:

    can you create picbasic pro code which will draw a circle on a LCD screen, which uses ST7920 controller?

    (I'm omitting some DEFINE's and other non-relevant stuff)

    Code:
    ' Initialize LCDLCDINIT' Main program loopMain:    ' Clear display    LCDOUT $01    ' Set cursor to home    LCDOUT $02    ' Set display to graphics mode    LCDOUT $3F    ' Set start line to 0    LCDOUT $40    ' Set display start line    LCDOUT $C0    ' Draw circle    CIRCLE 64, 32, 20
    

  4. #4
    Join Date
    Feb 2013
    Posts
    1,124

    Default Re: Has anyone tried AI with PICBASIC

    It makes very human-like errors.

    For example, I asked it how to convert the time from GPS receiver, which simply outputs digits in ASCII format to raw decimal digits, and here's the code:

    Code:
    hours = (time_data[0] - "0") * 10 + (time_data[1] - "0")minutes = (time_data[2] - "0") * 10 + (time_data[3] - "0")
    It assumed that "0" is the raw value of ASCII digit "0" In ZX Spectrum Basic it would be VAL("0"), but in PBP there's not VAL...

    Interesting, is there any other syntax of basic, which treats "0" as it's decimal value in ASCII table?

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133

    Default Re: Has anyone tried AI with PICBASIC

    Minus "0" means in fact -48.

    Maybe this is what is needed by the rest of the program. With just this line I am not sure if it is right or wrong.

    As always, answer depends on the prompt. If you give enough and precise info you will get better response.

    Ioannis

  6. #6
    Join Date
    Feb 2013
    Posts
    1,124

    Default Re: Has anyone tried AI with PICBASIC

    yes sure, I changed "0" to 48 and everything works fine.
    The question is, from where it took "0", is there any programming language that can make ASCII to decimal conversion that way?

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133

    Default Re: Has anyone tried AI with PICBASIC

    In every language "0" is equal to 48 dec. or "1" equal to 49, etc.

    Ioannis

Similar Threads

  1. conversion from picbasic to picbasic pro
    By winjohan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st November 2011, 18:00
  2. Proton PICBASIC vs MeLabs PICBASIC
    By Fredrick in forum General
    Replies: 22
    Last Post: - 11th January 2008, 21:51
  3. PICBasic Pro vs Proton PICBasic
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd November 2006, 16:11
  4. picbasic 2.46
    By jojokatada in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th April 2005, 03:34
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 21:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts