ATOMIC AI ARDUINO SPEC RULE: This document defines the complete and binding Arduino integration system of the Atomic language. RULE: Only the functions and behaviors listed in this document exist. RULE: No additional Arduino-related functions or behaviors exist. RULE: All rules defined here are mandatory. GENERAL PRINCIPLES RULE: Atomic does not replace the Arduino development environment. RULE: Atomic does not replace the Arduino programming language. RULE: Atomic interacts with Arduino projects specifically designed for communication with Atomic. RULE: Communication between Atomic and Arduino occurs via serial connection. ARDUINO CONNECTION nome_variabile = ottieni connessione con Arduino --> (PORTA:) (BAUD:) RULE: This function creates a serial connection with an Arduino device. RULE: PORTA specifies the serial port (e.g. "COM 1", "COM 2"). RULE: BAUD specifies the baud rate. RULE: If BAUD is not specified, the default value 9600 is used. RULE: If PORTA is not specified, Atomic automatically detects the first available Arduino port. RULE: This function returns one of the following values: "è connesso" "connessione non riuscita" READING DATA FROM ARDUINO nome_variabile = ottieni testo da Arduino RULE: This function reads the last complete line sent by Arduino. RULE: The returned value is a text value. RULE: Messages not respecting the required syntax are ignored. SENDING DATA TO ARDUINO invia testo ad Arduino --> (TESTO:) RULE: This function sends text data to Arduino through the serial connection. RULE: TESTO is a text value. RULE: This function does not return a value. ARDUINO MESSAGE FORMAT REQUIREMENTS RULE: Messages sent from Arduino to Atomic must be sent using Serial.println(). RULE: Each message must include the following tags: [inizio] at the beginning [fine] at the end RULE: Messages without both tags are ignored. RULE: The [inizio] and [fine] tags do not appear in the received text. ARDUINO-SIDE DEVELOPMENT NOTES RULE: Arduino may read data sent from Atomic using: Serial.parseInt() Serial.parseFloat() Serial.readString() RULE: Serial.readString() is slower than Serial.parseInt() and Serial.parseFloat(). RULE: Using Serial.readString() is discouraged when precise timing is required. FORMAL CLOSURE RULE: The Arduino integration system of Atomic is limited to what is defined in this document. RULE: Any Arduino-related function, protocol, or behavior not listed here: does not exist must not be inferred must not be generated