The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Hp prime chat terminal using arduino
07-03-2024, 05:43 PM
Post: #1
Hp prime chat terminal using arduino
Hi Guys,

I'm trying as the name suggests to create a program so i can send and receive text message's through the usb port. I have an arduino micro that supports usb hid and i'm using the nicohood hid project library. however i have no luck writing a program that wil do that. Using the usbopen() command i get (64,64) as response and using USBRecv() it returns an long ASCII beginning with (84,101,115,116... which corresponds to ''test'' which is sent by the arduino. this is the programm i'm trying to use.

Code:
EXPORT USBHIDCommunication()
BEGIN
  // Initialize graphic buffers
  DIMGROB_P(G1, 320, 240);
  RECT_P(G1, 0, 0, 320, 240, RGB(255, 255, 255));

  // Open USB HID connection
  USBOpen();

  LOCAL send_data := {1, 2, 3, 4, 5}; // Example data to send
  LOCAL received_data;
  
  // Main communication loop
  REPEAT
    // Send data
    USBSend(send_data);

    // Receive data
    received_data := USBRecv();
    
    // Display received data
    IF SIZE(received_data) > 0 THEN
      RECT_P(G1, 0, 0, 320, 240, RGB(255, 255, 255)); // Clear screen
      TEXTOUT_P("Received: " + STRING(received_data), 10, 10, 1, RGB(0, 0, 0), RGB(255, 255, 255));
      WAIT(1);
    END;

  UNTIL ISKEYDOWN(4); // Exit on pressing a key

END;

when opening the programm i get invalid input, i'm very new to HP PPL and not really sure if this code wil work or not or if anybody has done this before and is willing to share it. Does anybody have tips or ideas to help me?

thanks in advance.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Hp prime chat terminal using arduino - keestx - 07-03-2024 05:43 PM



User(s) browsing this thread: 2 Guest(s)