ChatGPT does not know JAL :-(

25 views
Skip to first unread message

rob...@hotmail.com

unread,
Jan 29, 2023, 12:22:05 PM1/29/23
to jallib
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

vsurducan

unread,
Jan 30, 2023, 12:35:02 AM1/30/23
to jal...@googlegroups.com
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...

--
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 jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/6bd003aa-9606-4ab5-9d5a-2a58e2cdf1c2n%40googlegroups.com.

Matthew Schinkel

unread,
Jan 30, 2023, 5:49:44 PM1/30/23
to jallib
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

Reply all
Reply to author
Forward
0 new messages