Close



Results 1 to 4 of 4
  1. #1
    Student BlackDragon's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, MO
    Posts
    21

    Marlin forgets about the rotary encoder

    So, I have an Arduino Mega/RAMPS 1.4, with a 20x4 LCD panel and a rotary encoder. I am using Marlin for the code.
    Everything is hooked up, code modified and compiled without any errors.

    When I first start the rig, the encoder will control the flow rate. I turn it clockwise, the flow rate drops. I turn it counter-clockwise, the flow rate increases. If I click, the screen switches to the menu. All of this tells me that the electronics and wiring are solid.

    Now for the problem.
    Once I click into the menu, the rotary stops working. I can click back to the monitor, but the rotary no longer works there either.

    I'm thinking that when the screen is changed, the focus for the encoder is not being set. However, I am having trouble finding where the code calls the encoder controls and what happens when screens change.

    Any assistance that might point me in the right direction would be appreciated.

  2. #2
    Technologist Kingoddball's Avatar
    Join Date
    Oct 2013
    Location
    Syd - Aust
    Posts
    193
    Whats your hardware and Marlin revision?
    Could be an LCD hardware problem?

    Could you list up for firmware config page.

    One odd thing: Clockwise to DROP the FR??
    Mine is Clockwise to increase, anti to decrease.
    All of my panels have been the same.
    Panelolu2 (Sanguino)
    Full Graphic Display (RAMPS)
    Standard LCD (cheapie)

  3. #3
    Student BlackDragon's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, MO
    Posts
    21
    LOL... yeah. I realized I had the encoder backwards. Finally swapped the pins for it this morning.

    The LCD and encoder are actually separate. (bought the parts and I'm building my own panel.) If it was the encoder, I would expect that it wouldn't work for anything, or would only work intermittently.

    Anyway, I'm using Marlin_v1 on an Arduino Mega 2560 R3, with a RAMPS 1.4.

    I tried pasting up my configuration.h, but it's too long to go here. What are you looking for? I can see if I can find the chunk of code, and get it up here.

  4. #4
    Student BlackDragon's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, MO
    Posts
    21
    ok... finally figured it out.

    So, in the pins.h, under ULTRA_LCD, there are several sets of pin definitions, sitting in an IF...ELSEIF...THEN structure.
    Since I was only using the NEWPANEL part of the code, that was the only place I had set the pin definitions for the LCD, the encoder and buzzer (note: the buzzer is not hooked up. This will be important in a moment).

    Now, I have a touch of OCD, so, just to keep everything looking good, I went through the rest of the ULTRA_LCD and set the pin definitions to the same values for each board type. While doing this, I noticed that under one section (LCD_I2C_PANELOLU2) the buzzer was set to pin 33. Will, as I said, I have a bit of OCD. Having pins spread across AUX-4 drove me crazy, so I moved everything down by the +5 and GND pins. This put one of the encoder pins on 33. Hmmm....

    I recompiled and uploaded. Low and behold, that darned thing is now working correctly. Apparently, when you pull up the menu, the program changes the panel being used. *shakes head*

    So, when changing pin definitions, change it for every section of code in the pins.h.

    Once I have this bugger working, I may see about making a new control code module. Less repetition, less chance to miss something. Then make a document that would give all of the correct values to put in, based on what board you are using.

Posting Permissions

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