Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: G6 on the Pi?

  1. #1
    Join Date
    Mar 2005
    Posts
    724

    Default G6 on the Pi?

    I am trying out the G6 Pi build but I am curious how do you interact with the GPIO and also will girder be able to control a Uirt?

    Thanks,
    Yonu

  2. #2
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    There are a few lua function to access the GPIO lines. Look at the manual under scripting/raspi
    Ron
    No support through PM

  3. #3
    Join Date
    Mar 2005
    Posts
    724

    Default

    thanks wasn't sure if it was build in as events/actions or it had to be Lua so that is easy as I already know how to access them in Lua so I guess I just have to transfer the code over to a Girder Script Action.

    Thanks,
    Yonu

  4. #4
    Join Date
    Mar 2005
    Posts
    724

    Default

    ok I just checked the manual I like that better than direct GPIO in straight Lua looks simpler now the big question how do you read a pin input to trigger an action?

    on a side note what needs to be required at the beginning of the scripts as I get this in the Lua console

    here is what I get in the Remote Girdser 6 lua console

    Fri Dec 6 21:18:54 2013 Scripting / [string "Scripting"]:1: attempt to index global 'raspi' (a nil value)
    Fri Dec 6 21:18:54 2013 stack traceback:
    Fri Dec 6 21:18:54 2013 [string "Scripting"]:1: in main chunk

    here is what I have for a scripting action
    print(raspi.export( 17 ))
    print(raspi.direction( 17, false ))
    print(raspi.read( 17))


    Thanks,
    Yonu

  5. #5
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    require('raspi')
    Ron
    No support through PM

  6. #6
    Join Date
    Mar 2005
    Posts
    724

    Default

    Thanks now just cause I am hoping I am not completely blind yet was that somewhere in the manual?

    And thanks,
    Yonu

  7. #7
    Join Date
    Mar 2005
    Posts
    724

    Default

    Thanks that worked perfect. now one more for you as I didn't see it in the manual what about keyboard events as I notice I don't get any in the logger?

    Thanks,
    Yonu

  8. #8
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    I'll make a note in the manual of this.

    There currently isn't a raspi keyboard plugin. I'll have to look into capturing keycodes on Linux...
    Ron
    No support through PM

  9. #9
    Join Date
    Mar 2005
    Posts
    724

    Default

    ok thanks and drats was hoping to use a usb keypad instead of a matix keypad (hate wasting pins)

    Thanks,
    Yonu

  10. #10
    Join Date
    Mar 2005
    Posts
    724

    Default

    hey question about capturing keystrokes in linux I know that this is extremely basic but would this help I am currently playing with it in a scriptting action to see if it will work for what I need but I thought it might help some towards a plugin.
    #!/usr/bin/lua

    function getch_unix()
    os.execute("stty cbreak </dev/tty >/dev/tty 2>&1")
    local key = io.read(1)
    os.execute("stty -cbreak </dev/tty >/dev/tty 2>&1");
    return(key);
    end

    for i=1 , 5 do
    io.write("Hit key==>")
    local key = getch_unix()
    io.write("\nYou pressed ")
    io.write(key)
    io.write("\n")
    end


    Thanks,
    Yonu

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •