Archive

Posts Tagged ‘library’

Arduino Library for the Parallax (Futaba) Continuous Rotation Servo

13 March 2013 1 comment

A while ago, I started a Google code project to share an Arduino library for the Parallax (Futaba) Continuous Rotation Servo

This project is a free initiative to create an Arduino library for the Parallax (Futaba) Continuous Rotation Servo.
The main goal is to provide a library that simplifies the usage of this particular servo in Arduino projects.

Available functions:

  • rotate(speed)
  • rotateLeft(speed) & rotateRight(speed)
  • rotateLeft(speed, time) & rotateRight(int speed, int time)
  • noMovement() & noMovement(time)

Library Usage:

  1. Download the source
  2. Place the ContinuousRotationServo? folder in your Arduino1.0+ “libraries” folder
  3. Open example sketch: “file”, “Examples”, “ContinuousRotationServo”, “Rotate” (or “RotateTime”)
  4. Connect the signal pin to port 2 (and connect Vcc and GND, ensure Vcc is able to source approx. 200 mA)
  5. Compile & upload code
  6. The servo should be moving as requested

Datasheet: http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/900-00008-CRServo-v2.2.pdf

Advertisements
Categories: Uncategorized Tags: , , ,

Arduino Library for the SRF04 Ultrasonic Ranger

26 December 2011 2 comments

I started a Google code project to share an Arduino library for the SRF04 Ultrasonic Ranger (distance sensor).

Overview:

This project is a free initiative to create an Arduino library for the SRF04 Ultrasonic Ranger. The main goal is to provide a library that simplifies the usage of this particular sensor in Arduino projects.

Range: approx. 3 to 300 cm

How the sensor works:

  1. You apply a short 10uS pulse to the trigger input to start the ranging.
  2. The SRF04  sends out an 8 cycle burst of ultrasound at 40khz and raises its echo line high.
  3. It then listens for an echo, and as soon as it detects one it lowers the echo line again.
  4. The echo line is  a pulse whose width is proportional to the distance to the object.
  5. By timing the pulse it is possible to calculate the range.

Library usage:

  1. Download the source
  2. Place the DistanceSRF04 folder in your Arduino1.0+ “libraries” folder
  3. Open example sketch: “file”, “Examples”, “DistanceSRF04”, “Centimeter” (or “Inch” or “Time”)
  4. Connect echoPin to pin 2, trigPin to pin 3 (and connect Vcc and GND)
  5. Compile & upload code
  6. Sensor data should be arriving over the serial port

More info & download: http://code.google.com/p/srf04-library/

Arduino Library for the Sharp GP2Y0A21YK IR Distance sensor

20 December 2011 19 comments

I started a Google code project to share an Arduino library for the Sharp GP2Y0A21YK IR Distance sensor

Overview:
This project is a free initiative to create an Arduino library for the Sharp GP2Y0A21YK IR distance sensor. The main goal is to provide a library that simplifies the usage of this particular sensor in Arduino projects.

How the sensor works:

  1. A pulse of IR light is emitted by the emitter.
  2. This light travels out in the field of view and hits an object.
  3. The reflected light returns to the detector and creates a triangle between the point of reflection, the emitter, and the detector.
  4. The angles in this triangle vary based on the distance to the object.
  5. The receiver uses a precision lens to transmits the reflected light onto various portions of the enclosed linear CCD array based on the angle of the triangle described above.
  6. The CCD array can then determine what angle the reflected light came back at and therefore, it can calculate the distance to the object.

Library usage:

  1. Download the source
  2. Place the DistanceGP2Y0A21YK folder in your Arduino1.0+ “libraries” folder
  3. Open example sketch: “file”, “Examples”, “DistanceGP2Y0A21YK”, “Centimeter” (or “Voltage” or “Raw”)
  4. Connect the analog sensor to port A0 (and connect Vcc and GND)
  5. Compile & upload code
  6. Sensor data should be arriving over the serial port

More info & download: http://code.google.com/p/gp2y0a21yk-library/