Quote:
Originally Posted by Ianuser
Thank you. I made encoder_22_count because For some reason when I compiled, it said that there were MULTIPLE DEFINITIIONS for All of those variables in the Encoder.c file...
|
If you don't get expected results after following the directions, it's usually because you didn't follow the directions correctly. Instead of trying to compensate for the error, it's better to retrace your steps and find out what you did wrong. For example, the multiple definitions problem can happen if you have accidentally put
#include encoder.c at the top of one of your files instead of
#include encoder.h.
The Gear Tooth Sensor is not limited to use with a CIM motor. All it needs is a set of rotating teeth that can affect a magnetic field. Do you have no sprockets or gears anywhere on the winch?
Limit switches have three connections:
common,
normally
open, and
normally
closed. The numbers after COM, NC, and NO are just pin numbers. When the switch is not pressed, the NO pin is open and the NC pin is connected to COM. When the switch is pressed, the NO pin is connected to COM and the NC contact is open.
The limit switch should be wired to a digital input on the Robot Controller. Connect the
common pin to the black (ground) wire, and connect either the
normally
open or
normally
closed pin to the white (signal) wire, depending on whether you want the signal to be grounded when the switch is pressed or when the switch is released. The red (+5) wire is not used. The digital input value is read as 1 when the switch is open, and 0 when it is closed.