Jump to content

36 Pots & 1 Encoder


jackchaos
 Share

Recommended Posts

All my pots use the AIN and I've decided to use 1 encoder as data wheel next to my LCD.

I looked at TK's clockbox example to see how he configured the application for an encoder and the only reference I found was this in main.c:

// set encoder speed mode of datawheel
MIOS_ENC_SpeedSet(0, DATAWHEEL_SPEED_MODE, DATAWHEEL_SPEED_DIVIDER);
Is this all I need? Setting the speed for the encoder (0)? Also, I'm using a lot of buttons and I'm halfway through my second DINX4. It looks like all I have to do is wire the encoder to 2 pins like shown in this schematic (http://www.ucapps.de/mbhp/mbhp_dinx4_16enc.pdf), and identify its enc enumeration like so:
|-----------------------------------|
|   .....   .....   .....   .oo..   |
|                                   |
|                                   |
|   .....   .....   .....   .....   |
|-----------------------------------|

On the second DINX4 this would be ENC 63 (the last one)?

P.S. My project is based on the C skeleton.

Link to comment
Share on other sites

Hi

you also need to add this encoder in mios_tables.inc (in the mios_wrapper subdir)

_MIOS_ENC_PIN_TABLE
MIOS_ENC_PIN_TABLE
	;; encoders 1-16
	;;        SR  Pin  Mode
	ENC_ENTRY  8,  6,  MIOS_ENC_MODE_DETENTED2	; datawheel

Since you only have one encoder this encoder has number 0 (first entry in the table)

Did you define DATAWHEEL_SPEED_MODE and DATAWHEEL_SPEED_DIVIDER somewhere?

in the clockbox example these are defined in main.h but this file isn't included in the skeleton

Michaël

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...