Has anyone tried AI with PICBASIC - Page 2


+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 41 to 80 of 89

Hybrid View

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

    Default Re: Has anyone tried AI with PICBASIC

    any bets on a new scammer using ai for an initiating post

    [still dosen't get over necro posting on a thread with last meaningful post in 2012]
    and PBP (Prescaler Basic Compiler). wtf

    https://support.melabs.com/forum/pic...mpile#post8869
    Name:  ai.jpg
Views: 908
Size:  140.4 KB
    Warning I'm not a teacher

  2. #2
    Join Date
    Apr 2003
    Location
    Cambridge - UK
    Posts
    1,041

    Default Re: Has anyone tried AI with PICBASIC

    Yes, chat-gpt could be prompted to produce a plethora of initial posts and relevant responses with subtle links to some commercial or other web site

    The spam bot could be coded to use the initial posts , then follow ip with the response and include the link

    However , we can handle that by the spam system filtering iut known addresses to prevent the initial post
    And forcing the first ‘n’ posts into moderation

    Though, ai generated questions , coyld be s great tool for prompting a discussion which could improve content and learning
    Lester - Forum Administrator
    -----------------------------------
    www.crownhill.co.uk

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,865

    Default Re: Has anyone tried AI with PICBASIC

    The reply to the melabs forum seems it is a chatGPT one. But the user is a real person I think based on this reply https://support.melabs.com/forum/pic...=8868#post8868

    We are entering a new era...

    Ioannis
    Last edited by Ioannis; - 27th February 2023 at 19:16.

  4. #4
    Join Date
    Apr 2003
    Location
    Cambridge - UK
    Posts
    1,041

    Default Re: Has anyone tried AI with PICBASIC

    The sarafoster reply??
    Lester - Forum Administrator
    -----------------------------------
    www.crownhill.co.uk

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,408

    Default Re: Has anyone tried AI with PICBASIC

    Quote Originally Posted by Ioannis View Post
    But the user is a real person I think based on this reply
    That reply post is also on a long dead necro thread and is total nonsense.
    in msc you just need to press the button to copy error message , right clicking window achieves nothing at all
    i suspect ai is making these things look more plausible, i expect a vast improvement in phising attempts and scam calls
    Name:  ai.jpg
Views: 1934
Size:  272.0 KB
    Warning I'm not a teacher

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,865

    Default Re: Has anyone tried AI with PICBASIC

    Quote Originally Posted by lester View Post
    The sarafoster reply??
    yes

    Quote Originally Posted by richard View Post
    i expect a vast improvement in phising attempts and scam calls
    Attachment 9337
    Agree. It would be much more difficult to distinguish a valid Bank email from a phising one.

    Ioannis

  7. #7
    Join Date
    Jul 2023
    Posts
    1

    Default Re: Has anyone tried AI with PICBASIC

    I've also been experimenting with AI and PICBASIC recently! I entirely agree with their potential together. I also came across an impressive AI tool called "PictoDream" which generates custom images from text descriptions using AI. Simple and transformative!https://www.gate2ai.com/tools/avatars/pictodream

  8. #8
    Join Date
    Feb 2013
    Posts
    1,090

    Default Re: Has anyone tried AI with PICBASIC

    I finally give it some try, but the code does not looks like a picbasic? It seems like it is using a different syntax to call subroutines? (can't verify right now, do not have PBP on this PC)


    Code:
    ' PICBASIC PRO code to read hours and minutes from DS3231 and send over serial port
    
    
    ' Define PIC16F877A configuration bits
    #CONFIG
        CONFIG FOSC = HS     ; High-speed oscillator
        CONFIG WDTE = OFF    ; Watchdog Timer disabled
        CONFIG PWRTE = ON    ; Power-up Timer enabled
        CONFIG BOREN = ON    ; Brown-out Reset enabled
        CONFIG LVP = OFF     ; Low-Voltage Programming disabled
        CONFIG CPD = OFF     ; Data memory code protection disabled
        CONFIG WRT = OFF     ; Flash Program Memory Write protection off
        CONFIG CP = OFF      ; Flash Program Memory Code protection off
    #ENDCONFIG
    
    
    ' Define constants
    DS3231_SDA   VAR PORTB.0  ; DS3231 Serial Data line
    DS3231_SCL   VAR PORTB.1  ; DS3231 Serial Clock line
    SERIAL_TX    VAR PORTD.1  ; Serial transmit pin
    
    
    ' Define variables
    Hours        VAR BYTE    ; Variable to store hours
    Minutes      VAR BYTE    ; Variable to store minutes
    
    
    ' Main program
    MAIN:
        TRISB.0 = 1         ; Set DS3231 SDA pin as input
        TRISB.1 = 1         ; Set DS3231 SCL pin as input
        TRISD.1 = 0         ; Set serial transmit pin as output
    
    
        ' Initialize I2C communication
        I2CSetup DS3231_SDA, DS3231_SCL, 100000
    
    
        ' Main loop
        DO
            ' Read hours from DS3231
            I2CStart
            I2CSend($D0)       ; DS3231 I2C address for writing
            I2CSend($00)       ; Send the register address for hours
            I2CStart
            I2CSend($D1)       ; DS3231 I2C address for reading
            Hours = I2CRead(1) ; Read hours and send acknowledgment
            I2CStop
    
    
            ' Read minutes from DS3231
            I2CStart
            I2CSend($D0)       ; DS3231 I2C address for writing
            I2CSend($01)       ; Send the register address for minutes
            I2CStart
            I2CSend($D1)       ; DS3231 I2C address for reading
            Minutes = I2CRead(0) ; Read minutes and send acknowledgment
            I2CStop
    
    
            ' Send hours and minutes over serial port
            SEROUT SERIAL_TX, T9600_16, ["Time: ", DEC Hours, ":", DEC2 Minutes, 13, 10]
    
    
            PAUSE 1000         ; Delay for some time before reading again
        LOOP
    
    
    ' Subroutine to initialize I2C communication
    I2CSetup:
        I2CWrite SDApin, SCLpin, I2C_HIGH   ; Set pins and speed
        RETURN

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,865

    Default Re: Has anyone tried AI with PICBASIC

    AI did some progress on learning PICBasic compiler but has long way...

    It uses some kind of function call to subroutines but sure it is not valid.

    Ioannis

  10. #10
    Join Date
    Feb 2013
    Posts
    1,090

    Default Re: Has anyone tried AI with PICBASIC

    I checked, that is Great Cow Basic syntax

  11. #11
    Join Date
    Feb 2013
    Posts
    1,090

    Default Re: Has anyone tried AI with PICBASIC

    I told him that he's using GCbasic syntax instead of PBP, and asked to fix it.

    While he (she, it?) is no longer using GCBasic style subroutine calls, it now uses some C++ syntax

    Code:
    ' PICBASIC PRO code for reading voltage from ADS1115 via I2C
    
    
    ' Define I2C settings
    #IFNDEF __PCM
      DEFINE I2C_SDA_PORT = PIN_A0   ' Define SDA pin
      DEFINE I2C_SCL_PORT = PIN_A1   ' Define SCL pin
    #ENDIF
    DEFINE I2C_CLOCK 100000   ' Set I2C clock frequency to 100 kHz
    
    
    ' Define constants
    ADS1115_ADDRESS   CON   $48   ' I2C address of ADS1115 (A5 and A4 connected to GND)
    CONFIG_REG        CON   $01   ' Address of the configuration register
    CONVERSION_REG    CON   $00   ' Address of the conversion register
    
    
    ' Define variables
    Data_MSB          VAR   BYTE
    Data_LSB          VAR   BYTE
    ConversionResult  VAR   WORD
    Voltage           VAR   FLOAT
    
    
    ' Initialize I2C communication
    I2CWRITE ADS1115_ADDRESS, [CONFIG_REG, $C3, $83] ' Set configuration for continuous conversion mode
    
    
    ' Main loop
    DO
      ' Request a conversion
      I2CWRITE ADS1115_ADDRESS, [CONFIG_REG, $C3, $83] ' Start a new conversion
      
      ' Wait for conversion to complete
      PAUSE 50   ' Adjust the delay based on your requirements
      
      ' Read conversion result
      I2CREAD ADS1115_ADDRESS, [CONVERSION_REG], Data_MSB, Data_LSB
      ConversionResult = MAKEWORD(Data_MSB, Data_LSB)
    
    
      ' Process the result (assuming full-scale range is 4.096V)
      Voltage = ConversionResult * 4.096 / 32768.0
      
      ' Your code to use the Voltage value as needed
      
      ' Add a delay or perform other tasks as needed
      PAUSE 1000   ' Adjust the delay based on your requirements
    LOOP

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