Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2015-11-10 13:09:43

md52
Member
Registered: 2015-10-29
Posts: 3

REXduino hex masks

How do I use the hex mask for Arduino MEGA2560? I do not understand the configuration parameters.

Offline

#2 2015-11-10 13:22:00

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: REXduino hex masks

When the HEX mask is used, the pin modes are defined by hexadecimal numbers. E.g. for pins 0 to 7 the parameter pinmodes_00_07 can be 0x320A0800, which means:
pin 7: mode 3 = digital input
pin 6: mode 2 = digital output
pin 5: mode 0 = not used
pin 4: mode A = counter DIR
pin 3: mode 0 = not used
pin 2: mode 8 = counter pulses
pin 1: mode 0 = not used
pin 0: mode 0 = not used

Note the reversed order.

Numbering of the modes is the following:
0: Not connected
1: Not connected
2: Digital output
3: Digital input
4: Digital input with internal pull-up
5: Analog output (PWM)
6: Analog input
7: 1-Wire temperature
8: Counter (only pins 2 and 3)
9: Encoder A (only pins 2 and 3)
A: Counter DIR / Encoder B (only pins 4 and 5, pin pairs are 2+4 and 3+5)

Offline

Board footer

Powered by FluxBB