Hi,
Code: Alles auswählen
// Outputs of the main module ( polarity )
// Base+0x40: |M4B |M4A |M3B |M3A |M2B |M2A |M1B |M1A |
unsigned char M_Main;
With M_Main you control the outputs bit-wise. You must initialize M_Main to use the outputs, i.e. if you want to use O1 you must write a 0x01 (= binary 00000001) to it.
Every bit in M_Main corresponds to an output, i.e. O6 is switched on writing a 0x20(= binary 00100000), or 0xAA (= binary 10101010) switches on O8, O6, O4, O2. On the second step you initialize the speed with sTrans.MPWM_Main[].
What is about the "blink1" project in the demo-folder? It should switch on/off output O1 every half second. Does this demo-program work?
If it does, use this project as a template for your own code, this will be the easiest way.
In the "old" forum (unfortunately not available) I showed some functions for easy use of the outputs - I will try to find them.
Another question: Are you bound to the use of C or is it possible to use an other language? Some time ago I made a BASIC-Compiler for the robo-interface. The programs were cross-compiled on the PC and then downloaded to the Robo-Interface - there is easy use of in- and outputs, Multi-Tasking, re-entrant functions, etc.... Let me know if you're interested, it's freeware.
---------------------------------
edit:
I had a look at the example and found an additional statement which should be used:
Code: Alles auswählen
sTrans.MPWM_Update = 0x01; // Update PWM values every 10ms
--------------------------------
Ford: Danke für deinen hilfreichen und qualifizierten Kommentar. Als Admin eines "großen Forums" sollte man.... ach, lassen wir das.