Asked — Edited

Counting Switch Closures

Hello all, just a quick question and I'm sure it will be simple. what I'm looking for is something to count how many times a switch closes. is there something in ARC? i want to use a switch to count wheel rotation, kinda like a encoder.

thanks, airwave1206


ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

PRO
USA
#1  

Quote:

is there something in ARC?
No.

Quote:

kinda like a encoder.

  1. You will need to add external hardware:
  2. add some EZ-Script to handle the external hardware.
PRO
Synthiam
#2  

Depends what you're attempting to do? Are you wanting to count rotation of a wheel encoder to see how far a robot has driven? Are you trying to move a head or arm a specific number of ticks? There's different solutions for different applications.

  1. You could use a hardware interrupt from a dedicated pcb, such as arduino. And connect the Arduino to the ez-b. This is because the EZ-B is already doing a significant amount of i/o processing with video, audio, wifi, servos, etc.. So offloading the counting to an arduino will work great. Send the count data to the

OR

  1. If the rotation is slow (i.e. < 2 / second), then you can use an EZ-B v4.x/2 or IoTiny without additional hardware and simply read the digital port. If you have an onboard computer in the robot, this rotation count speed can be increased dramatically by using a USB<->Serial connection to the ez-b

OR

  1. Use a third party motor controller with built-in encoder to offload the work, such as a Sabertooth with Kangaroo.

Obviously #2 is the easiest because it doesn't require additional hardware.

#3  

thanks everyone for the input. I've seen the arduino encoder post. DJ, I do have a on board pc and the ezb4 running on usb. I might try option #2. I was just trying something easy. thank you all.

PRO
Synthiam
#4  

yeah, #2 will work great for you with USB. Like i said, a slow count with #2 can work over WiFi. However, with wifi there is unpredictable delay/latency that is acute to the wireless properties and interference. With USB, it is direct and super fast.