Java API for UDOO

Discussion in 'General Programming Discussion' started by Flavio Pompermaier, Apr 13, 2016.

  1. Flavio Pompermaier

    Flavio Pompermaier New Member

    Joined:
    Apr 13, 2016
    Messages:
    20
    Likes Received:
    2
    Hi to all,
    I'm new to Udoo and I'd like to use Java to interface with it.
    However I can't find any good resource to start with.
    I've looked at https://github.com/UDOOboard/serial_libraries_examples/tree/master/java but I don't understand what is the goal of that code..those examples just connect to the serial port..and then??
    What if I'd like to listen for an input port or switch on a led?? How can I do that with Java?
    Jarduino seems to be what I'm looking for but maybe there are also other resources about Udoo and Java that I'm not able to find...

    Thanks in advance for any support,
    Flavio
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,162
    Likes Received:
    551
  3. Flavio Pompermaier

    Flavio Pompermaier New Member

    Joined:
    Apr 13, 2016
    Messages:
    20
    Likes Received:
    2
    Yes. Do that library work also for the new Udoo quad?
     
  4. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    Check out the code at http://www.cuhka.com/pmwiki/pmwiki.php?n=Garage.IsTheDoorClosed where there is a simple Arduino part that writes state change of a reed switch to the serial, and a Java part that reads this state change and posts an MQTT message on the network for that. Of course, what you do with a state change is up to you.
     
  5. Flavio Pompermaier

    Flavio Pompermaier New Member

    Joined:
    Apr 13, 2016
    Messages:
    20
    Likes Received:
    2
    Do I really need an Arduino part..?
     
  6. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    Guess you could try using http://pi4j.com/ and use the Linux GPIO pins. Haven't got round to trying it myself, let me know how it works out.
     
  7. Flavio Pompermaier

    Flavio Pompermaier New Member

    Joined:
    Apr 13, 2016
    Messages:
    20
    Likes Received:
    2
    I saw it but is seems to be targeted to Raspberry, I doubt it will work on Udoo...isn't it?
     
  8. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    I don't know, maybe the native source needs adjustment, but I really haven't looked into it.
     
  9. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,162
    Likes Received:
    551
    The principle to access gpio from the Linux side is the same, the pin out numbering could be different.

    The principle to interact between the linux and Arduino side with a serial port is the same, the serial port names are different.
     

Share This Page