1. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Download Package Now!
  2. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  3. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.

Teensy LC/Arduino Scripts

Discussion in 'Electronic and hardware generally' started by Nick Moxley, Jan 29, 2017.

  1. tadythefish

    tadythefish Active Member

    Joined:
    Jul 8, 2009
    Messages:
    130
    Occupation:
    Process automation engineer
    Location:
    Slovenia
    Balance:
    237Coins
    Ratings:
    +84 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Should be doable:) ok i will try to write you a sxript for testing... Do you have the encoders and a teensy? Wich teensy do you have? You said two encoders what is the other ones function?
    The first encoder you specified the keystrokes for direction turning, can you pecify keystrokes for up,down,left and right?
    • Friendly Friendly x 1
  2. narbi

    narbi New Member

    Joined:
    Feb 18, 2018
    Messages:
    7
    Location:
    France
    Balance:
    62Coins
    Ratings:
    +3 / 0 / -0
    Encoders and teensy are on their way, should be here before the end of the week. I should be able to have some hardware ready next week end.
    Teensy LC.
    Only one encoder per teensy, as the purpose is the same, they only need to control 2 separate devices, it's easier that way.
    So one basic script is good, I will modify it for the second one changing the keystrokes, or keycodes, or whatever you will use.

    Push button : CTRL P
    Rotary clockwise : CTRL =
    Rotary counter clockwise : CTRL -
    Pad UP : CTRL N
    Pad DOWN : CTRL L
    Pad Left : CTRL SHIFT Left Arrow
    Pad Right : CTRL SHIFT Right Arrow

    Thank you for your help
  3. tadythefish

    tadythefish Active Member

    Joined:
    Jul 8, 2009
    Messages:
    130
    Occupation:
    Process automation engineer
    Location:
    Slovenia
    Balance:
    237Coins
    Ratings:
    +84 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    I will do my best:)
    • Friendly Friendly x 1
  4. narbi

    narbi New Member

    Joined:
    Feb 18, 2018
    Messages:
    7
    Location:
    France
    Balance:
    62Coins
    Ratings:
    +3 / 0 / -0
    I got it working the way I wanted, I just had to adapt your code to my needs, but with the help of the included examples and online help I figured it out.
    Working flawlessly in both different situations.
    Attached are both codes.
    I changed the wiring too, COM + Enc-COM + Ground go to pin 0, push button to pin 2.

    Attached Files:

    • Winner Winner x 2
    • Informative Informative x 1
  5. tadythefish

    tadythefish Active Member

    Joined:
    Jul 8, 2009
    Messages:
    130
    Occupation:
    Process automation engineer
    Location:
    Slovenia
    Balance:
    237Coins
    Ratings:
    +84 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    I am so sorry I couldn't help you. I'm on vacation and I don't have my laptop with me :/ But on rhe other hand I'm very happy. I like helping people but if you pulled off the project your self you learned alot:) like cheat sheets in school... If you wrote them your self you probably don't need them but if someone else wrote them for you you know nothing about the subject:)))
    This is the reason if you go to the Arduino or Teensy forums people will help you but they will not write whole codes for you ;) but this forum is different that is why I help people and write code for them. But you did is perfect!
    A little heads up.. If you use Pin0 and Pin1 you can't use Serial1 on theensy or Serial on arduino. Those pins are tipically avoided. But if you don't need Serial communication it's ok;)
    These Teensy boards are beasts. Check out the 3.6 it can run over 200MHz:) I use one for my Ethernet 2dof +traction loss servo controler:)

    Anyway this is exelent news if you have any questions or in need of help don't hesitate to contact me.

    Oh and THANK YOU for sharing your code with others!

    Sharing is caring!
    Open source is the way! :))
    • Like Like x 1
    • Friendly Friendly x 1