I'm trying to run a stepper motor using CONTROLLINO MEGA and a stepper driver (DM332T), but I'm not gettin' much progress.
One of the things that calls my attention is that I use pin D8 (for example) of controllino as an output. When I run the code, the light of this pin should blink according to the code. The impressive thing is that pin 8 remains off and pin 6 does what pin 8 should do.
So I tried to use one of the example codes on ARDUINO IDE library (Basics>Blink). I use it to make pin 10 blink, but the pin that blinks when I run the code is pin 8. If I want pin 7 to blink, is the pin 5 that does it. Basically, the pin that I use in my codes does not do what it should. Instead, the pin "2 positions earlier" does it.
Is it normal? I'm getting confused because I'dont know how should I build the circuit (to run the motor) because of this.
Have a look at the diagram and see where D6 connects to the processor ( it’s too blurred on my phone ).
Have a look at the schematic for a Arduino Mega and see where D6 connects - if they are different that’s the issue .
There must be some examples with a library for that device , they may help too as will a good look at the documentation . As it’s not an Arduino product there may well be such differences , such as bringing out more I/O Pins .
Yes I did! But you were right!! The schematic of CONTROLLINO MEGA match' each pin to ARDUINO MEGA, and it happens exactly what I was describing I think:
So I guess that if I want to do something with PIN 7 on CONTROLLINO MEGA, I have to write PIN 9 on ARDUINO IDE, right? Even If I have loaded the library of CONTROLLINO..
Otherwise, I think I have to use the above table, but Im not sure how to interpret it... Any explanation?
There is a board manager and you select that board within the ide ( and not Arduino mega ) I would have thought all the differences would be then be sorted out for you .
I see from the site , there are downloads to install. Have a good read of the instructions , it does include a board manager and controllio should then appear in your boards list and the O/I then line up
.
Yes, this is the firs that I did before running any code. I have selected CONTROLLINO MEGA on tools>board and I have included the controllino library on the top of the code, but still PIN 8 blinks when I want PIN 10 to do it.
In your sketch ( located in this post - please don't crosspost, put all information in one thread ) you use simply numbers to address the pin. You should try with 'D10' instead. In the schematic above '10' relates to 'D8', and '12 to 'D10'. I assume the CONTROLLINO board definitions map 'D10' to the correct pin.