Permalink
Browse files

added readme & license

  • Loading branch information...
1 parent be15910 commit 7c4d20b091dc502ea927ab531f36c4714bb1a5c5 @kevin-pololu kevin-pololu committed May 4, 2012
View
@@ -0,0 +1,25 @@
+Copyright (c) 2012 Pololu Corporation. For more information, see
+
+http://www.pololu.com/
+http://forum.pololu.com/
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
View
@@ -20,7 +20,7 @@ void PololuQik::init(long speed /* = 9600 */)
write(0xAA); // allow qik to autodetect baud rate
}
-uint8_t PololuQik::getFirmwareVersion()
+char PololuQik::getFirmwareVersion()
{
write(QIK_GET_FIRMWARE_VERSION);
while (available() < 1);
View
@@ -54,7 +54,7 @@ class PololuQik : public SoftwareSerial
void init(long speed = 9600);
- uint8_t getFirmwareVersion();
+ char getFirmwareVersion();
uint8_t getErrors();
uint8_t getConfigurationParameter(uint8_t parameter);
@@ -1,17 +1,16 @@
/*
Optionally writes, then reads, the configuration parameters on the qik 2s12v10.
-Please note that the memory used to store these parameters is only rated
-for approximately 100,000 erase/write cycles, so you should avoid
-repeatedly setting configuration parameters. It is intended that these
-parameters will initially be configured as desired and then only changed
-occasionally (they are saved in non-volatile memory, which means that
-once set, these parameters will retain their values even if the unit is
-powered off). For example, you can uncomment the appropriate calls to
-setConfigurationParameter() below and run this program once to
-initialize the parameters. Then, you can load your final program on your
-Arduino, which should assume that the parameters have already been set
-correctly.
+Please note that the memory used to store these parameters is only rated
+for approximately 100,000 erase/write cycles, so you should avoid
+repeatedly setting configuration parameters. It is intended that these
+parameters will initially be configured as desired and then only changed
+occasionally (they are saved in non-volatile memory, which means that
+once set, these parameters will retain their values even if the unit is
+powered off). For example, you can uncomment the appropriate calls to
+setConfigShowResult() below and run this program once to initialize the
+parameters. Then, you can load your final program on your Arduino, which
+should assume that the parameters have already been set correctly.
Required connections between Arduino and qik 2s9v1:
@@ -1,17 +1,16 @@
/*
Optionally writes, then reads, the configuration parameters on the qik 2s9v1.
-Please note that the memory used to store these parameters is only rated
-for approximately 100,000 erase/write cycles, so you should avoid
-repeatedly setting configuration parameters. It is intended that these
-parameters will initially be configured as desired and then only changed
-occasionally (they are saved in non-volatile memory, which means that
-once set, these parameters will retain their values even if the unit is
-powered off). For example, you can uncomment the appropriate calls to
-setConfigurationParameter() below and run this program once to
-initialize the parameters. Then, you can load your final program on your
-Arduino, which should assume that the parameters have already been set
-correctly.
+Please note that the memory used to store these parameters is only rated
+for approximately 100,000 erase/write cycles, so you should avoid
+repeatedly setting configuration parameters. It is intended that these
+parameters will initially be configured as desired and then only changed
+occasionally (they are saved in non-volatile memory, which means that
+once set, these parameters will retain their values even if the unit is
+powered off). For example, you can uncomment the appropriate calls to
+setConfigShowResult() below and run this program once to initialize the
+parameters. Then, you can load your final program on your Arduino, which
+should assume that the parameters have already been set correctly.
Required connections between Arduino and qik 2s9v1:
View
@@ -0,0 +1,99 @@
+h1. Arduino library for the Pololu qik dual serial motor controllers
+
+Version: 1.0.0
+Release Date: 2011-05-07
+"www.pololu.com":http://www.pololu.com/
+
+h2. Summary
+
+This is a library for the "Arduino":http://pololu.com/catalog/product/2191 that interfaces with the Pololu "qik 2s9v1":http://www.pololu.com/catalog/product/1110 and "qik 2s12v10":http://www.pololu.com/catalog/product/1112 dual serial motor controllers. It makes it easy to control two brushed DC motors with a simple serial interface.
+
+h2. Getting Started
+
+h3. Software
+
+Download the archive from "GitHub":https://github.com/pololu/qik-arduino, decompress it, and drag the "PololuQik" folder to your arduino-x.x/libraries directory. Then restart the Arduino environment, so the libraries can be updated to include the library and its examples.
+
+h3. Hardware
+
+The qik controllers can be purchased on Pololu's website using the links above. See the user's guides for the "2s9v1":http://www.pololu.com/docs/0J25 and "2s12v10":http://www.pololu.com/docs/0J29 for more details.
+
+The example programs require the following connections to be made with wires between the Arduino and the qik:
+
+pre. Arduino qik 2s9v1
+ 5V -> VCC
+ GND -> GND
+Digital Pin 2 -> TX
+Digital Pin 3 -> RX
+Digital Pin 4 -> RESET
+
+pre. Arduino qik 2s12v10
+ GND -> GND
+Digital Pin 2 -> TX
+Digital Pin 3 -> RX
+Digital Pin 4 -> RESET
+
+*Do not* connect the 5V output on the Arduino to the 5V output on the qik 2s12v10!
+
+h2. Example Programs
+
+Open an example code sketch by selecting File->Examples->PololuQik->example_name.
+
+h3. Qik2s9v1Demo/Qik2s12v10Demo
+
+Each of these programs ramps motor 1 from stopped to full speed forward, ramps down to full speed reverse, and back to stopped. Then, it does the same with the other motor. For the qik 2s12v10, both motors' current readings are sent over serial and can be seen with the serial monitor.
+
+h3. Qik2s9v1Config/Qik2s12v10Config
+
+Each of these programs reads and displays the configuration parameters of the qik. They can also be used to change the configuration parameters by uncommenting and editing the appropriate calls to @setConfigShowResult()@.
+
+The configuration parameters are stored in non-volatile memory that is rated for a limited number of erase/write cycles, so they are not intended to be written frequently. (Once set, these parameters will retain their values even if the qik is powered off.) If you need to change the parameters, we recommend that you run the configuration program once to set them and then load your final program on your Arduino, which should assume that the parameters have already been set correctly. See the comments at the top of the configuration programs and the user's guides for more details.
+
+h2. Library Details
+
+This library defines a @PololuQik@ base class that implements commands common to both versions of the qik. Two derived classes, @PololuQik2s9v1@ and @PololuQik2s12v10@, handle commands specific to each version.
+
+The PololuQik class is itself derived from the @SoftwareSerial@ class, so you can use SoftwareSerial member functions (like @write()@ and @listen()@) for direct access to the serial interface used to communicate with the qik.
+
+This library uses the compact protocol, not the Pololu protocol, so it cannot be used to control multiple qiks daisy-chained together on the same serial line.
+
+h2. Library Reference
+
+h3. PololuQik
+
+- @PololuQik(uint8_t receivePin, uint8_t transmitPin, uint8_t resetPin)@ := Constructor; sets pins as specified. Note that the receive and transmit pins are specified from the perspective of the *Arduino* (so the receive pin should be connected to the TX pin on the qik and the transmit pin should be connected to the RX pin on the qik).
+
+- @void init(long speed = 9600)@ := Resets the qik and initializes serial communication with it at the specified baud rate (defaults to 9600 bps if unspecified).
+
+- @char getFirmwareVersion()@ := Returns an ASCII byte that represents the version of the firmware running on the qik.
+- @uint8_t getErrors()@ := Returns a byte that indicates any errors that have been detected since the errors were last read. See the user's guides for the meaning of each bit.
+
+- @uint8_t getConfigurationParameter(uint8_t parameter)@ := Returns the current value of the specified configuration parameter.
+- @uint8_t setConfigurationParameter(uint8_t parameter, uint8_t value)@ := Sets the specified configuration parameter to the specified value.
+
+- @void setM0Speed(int16_t speed)@ := Sets speed and direction for motor M0. @speed@ should be between -127 and 127 in 7-bit mode or -255 and 255 in 8-bit mode. Positive values correspond to motor current flowing from the + pin to the - pin. Negative values correspond to motor current flowing from the - pin to the + pin.
+- @void setM1Speed(int16_t speed)@ := Sets speed and direction for motor M1.
+- @void setSpeeds(int16_t m0Speed, int16_t m1Speed)@ := Sets speed and direction for both motors.
+
+h3. PololuQik2s9v1
+
+- @void setM0Coast()@ := Sets motor M0 to coast.
+- @void setM1Coast()@ := Sets motor M1 to coast.
+- @void setBrakes(int m1Brake, int m2Brake)@ := Sets both motors to coast.
+
+h3. PololuQik2s12v10
+
+- @void setM0Brake(uint8_t brake)@ := Sets brake for motor M0. @brake@ should be between 0 and 127. 0 corresponds to full coast, and 127 corresponds to full brake.
+- @void setM1Brake(uint8_t brake)@ := Sets brake for motor M1.
+- @void setBrakes(uint8_t m0Brake, uint8_t m1Brake)@ := Sets brake for both motors.
+
+- @uint8_t getM0Current()@ := Returns raw current reading from motor M0.
+- @uint8_t getM1Current()@ := Returns raw current reading from motor M1.
+- @uint16_t getM0CurrentMilliamps()@ := Returns current reading from motor M0 in milliamps.
+- @uint16_t getM1CurrentMilliamps()@ := Returns current reading from motor M1 in milliamps.
+- @uint8_t getM0Speed()@ := Returns the present target motor speed for motor M0.
+- @uint8_t getM1Speed()@ := Returns the present target motor speed for motor M1.
+
+h2. Version History
+
+* 1.0.0 (2012-05-07): Original release.

0 comments on commit 7c4d20b

Please sign in to comment.