News:

;) This forum is the property of Proton software developers

Main Menu

C Language Support ?

Started by Fanie, Oct 10, 2025, 01:38 PM

Previous topic - Next topic

RGV250

QuoteWhat has AI actually got wrong?

Quote'--- Variable definitions ---
temp_word VAR WORD       ' Raw 16-bit temperature data
temp_low VAR BYTE        ' Low byte of temperature data
temp_high VAR BYTE       ' High byte of temperature data
DQ_state VAR BIT         ' Holds the state of the DQ pin
Positron doesn't declare variables like that, I think it is PicBasicPro?

Quote' HSer_Baud = 9600
It is commented out but Positron does not declare baud rate like that.

Quote' HSerOut "Temperature: ", Dec temp_word, " raw", 13, 10
Again commented out but no square backets.

Quote' Manual 1-Wire reset sequence
OneWire_Reset:
    DQ_TRIS = 0         ' Set pin to output
    DQ_PIN = 0          ' Drive low
    DelayUS 500         ' Hold low for >480us for reset pulse
    DQ_TRIS = 1         ' Set pin to input (release bus)
    DelayUS 80          ' Wait for presence pulse response
    DQ_state = DQ_PIN   ' Check for presence pulse (low)
    DelayUS 420         ' Complete the 480us+ recovery slot
    Return
Why does it need to do this, I have never seen it needed in any Positron example.

Quote' Read the two temperature bytes from the scratchpad
    ORead DQ_PIN, 2, [temp_low, temp_high]
   
    temp_word.LowByte = temp_low   ' Store the low byte
    temp_word.HighByte = temp_high ' Store the high byte
It could have aliased the high and low byte in the read line.

Quote' End If
This would have thrown up an error as Positron does not have a space.

Quote'   temp_word = temp_word >> 4 * 100
    '   HSerOut "Temperature: ", Dec temp_word, " C", 13, 10
Not sure that calculation is correct for centigrade either but not going to check.

Main: / Goto Main is very old now so surely it should have used Do / Loop.

Just seems good at copying and pasting anything it can find.

Bob






Fanie

#21
I agree, however the basic commands is there and shouldn't be too difficult to use.

I did some more AI searches on various other code solutions, and it can only copy what others already did, hence my comment

The I in AI is not that I after all.  It can only present what has been done already, hence someone else's I.

See_Mos

Quote from: Frizie on Oct 13, 2025, 04:46 PMWhat has AI actually got wrong?

The AI response for the ESP32 mentions Proton but not Positron.

Try a different AI engine?