Works for me but it needs work

Google's LaMDA seems like a better AI from its conversation posted on 
youtube.


I asked ChatGPT to write a PID program in JALv2 (asking for JAL also works).

' PID program in JALv2
' Variables for PID control
dim setpoint as word
dim process_value as word
dim error as word
dim previous_error as word
dim integral as word
dim derivative as word
dim control_output as word

' Constants for PID control
const Kp as word = 50
const Ki as word = 10
const Kd as word = 5

' Setpoint, process value, and initial conditions
setpoint = 1000
process_value = 0
previous_error = 0
integral = 0

' Main loop for PID control
do
  ' Calculate error
  error = setpoint - process_value
  
  ' Update integral
  integral = integral + error
  
  ' Calculate derivative
  derivative = error - previous_error
  
  ' Calculate control output
  control_output = Kp * error + Ki * integral + Kd * derivative
  
  ' Apply control output to process
  ' Code to control the process goes here
  
  ' Update previous error
  previous_error = error
  
  ' Wait for next iteration
  wait 1
loop

On Monday, January 30, 2023 at 12:35:02 AM UTC-5 vasile wrote:

> Beware Rob.
> I suggest you see a movie prior to teaching AI anything. It's called 
> "Somebody", Korea 2022.
> Unless you want uncontrollable modifications to your jal pack...
>
> On Sun, Jan 29, 2023 at 7:22 PM [email protected] <[email protected]> 
> wrote:
>
>> Hi all,
>>
>> I see people using ChatGPT to make programs for Arduino. I thought to 
>> give it a try and asked ChatGPT if it could write a JAL program for a PIC 
>> microcontroller.
>>
>> The response was as folows:
>>
>> "I apologize, but as JAL is not a programming language that I am aware 
>> of, I am unable to provide a sample program for it. If you provide more 
>> information about JAL such as specifications, syntax, and libraries, I 
>> would be happy to help you create a program. Also, PIC microcontroller are 
>> programmable with a variety of languages such as C, Basic, and Assembler. 
>> It would be helpful to know which type of PIC Microcontroller you have, and 
>> what would you like to achieve with the program."
>>
>> We need to learn this AI some JAL :-)
>>
>> Kind regards,
>>
>> Rob
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jallib/6bd003aa-9606-4ab5-9d5a-2a58e2cdf1c2n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jallib/6bd003aa-9606-4ab5-9d5a-2a58e2cdf1c2n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/7295bb7b-5453-47c1-870c-934fabb92fabn%40googlegroups.com.

Reply via email to