OzStepCounter

This device counts the steps of x, y, z, a, b, c steppermotors. It is counted from the step signals sent out from the microcontroller.

This device only works on Arduino MEGA 2560 when connecting the step and direction outputs to the following pins:

  • STEPX: 21; DIRX: 11;
  • STEPY: 20; DIRY: 10;
  • STEPZ: 19; DIRZ: 9;
  • STEPA: 18; DIRA: 8;
  • STEPB: 2; DIRB: 7;
  • STEPC: 3; DIRC: 6;

How to test the step counter on Arduino Mega?
Arduino codes are included.

For help, here is the Arduino MEGA 2560 pinout (look at the numbers with the pink background).

You can download the Hungarian user's guide from here.

I. "welcome" event from microcontroller

Example

c=welcome&id=ybnREm&type=OzStepCounter&pos=2&t=3

Parameters

Parameter Type Range Functionality
c String "welcome" Identifies the welcome message.
id String 6 characters (numbers, uppercase and lowercase characters) The ID of the device which is chosen by the microcontroller.
type String "OzStepCounter" Determines the type of the device.
pos Byte 0-255 Determines the position of the device on the list of the ID manager of the microcontroller. Please make sure there are no other devices in the same position.
t Byte 0-255 Counts the number of events and responses sent combined. Counts from 0 to 255 then from 0 again.



II. Commands to microcontroller

None

III. Event from microcontroller

"went" event

This event is sent out if we measure stepper motor movement signals. If a motor is not ordered to move, it won't send anything about that motor.

Example

//movement measured on x,y,cs
c=went_event&x=-50&y=200&cs=-9215&id=ybnREm&t=1

Parameters

Parameter Type Range Functionality
c String "went_event" Identifies the event.
Axis value (x | y | z | a | b | cs) +/- Unsigned Long Int -4294967295 to 4294967295 Determines which motor was ordered to move and how much steps in which direction. Motors can be <x, y, z, a, b, cs>. The last motor is called cs, since 'c' is already used as a command and event identifier.
id String 6 characters (numbers, uppercase and lowercase characters) Identifies the device. The ID is never changed during communication.
t Byte 0-255 Counts the number of events and responses sent combined. Counts from 0 to 255 then from 0 again.

More information