Skip to content

arduino mega  #79

@takfa1992

Description

@takfa1992

at the beginning I would like to congratulate you on your work.
i tried the "" cdservoMega_magneticEncoder_brushlessMotor "" file on my arduino mega. It does not work. AND THE SERIAL MONITOR IS NOT RESPONDING.
I tried the file "" dcservoUNO "" the serial monitor responds. I turn the motor in both directions the position does not change but the traget only increases. I think the problem is this part of the code
"ISR (PCINT0_vect) {// handle pin change interrupt for D8
Old = New << 2;
New = (PINB & 1) + ((PIND & 4) >> 1); //
encoder0Pos + = QEM [Old + New];

}

void encoderInt () {// handle pin change interrupt for D2
Old = New << 2;
New = (PINB & 1) + ((PIND & 4) >> 1); //
encoder0Pos + = QEM [Old + New]; ""
could you help me run your code on an arduino mega. my configuration: a mitsumi m21 2r 14 2241 dc motor with its rotary encoder
and I also have dc motors with linear encoders found in print
Sans titre

thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions