Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Kornacki committed Feb 7, 2017
1 parent c70862c commit a31f114
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 9 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Every driver is published as separeate lib to maven repository.

Implemented drivers
-----------------------

All samples work on Raspberry Pi 3 only.<br/>

Driver | Type | dependecy definition| usage
:---:|:---:| --- | ---
[ULN2003](uln2003) | stepper motor| `compile 'com.polidea.androidthings.driver:uln2003:0.0.1-SNAPSHOT'` | [tutorial](https://github.com/Polidea/Polithings/tree/master/uln2003) [sample](https://github.com/Polidea/Polithings/blob/master/app/src/main/kotlin/com/start/bootstrap/example/StepperMotorActivity.kt)
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/kotlin/com/start/bootstrap/NumpadActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ class NumpadActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Numpad(c1GpioId = "BCM13",
c2GpioId = "BCM5",
c3GpioId = "BCM26",
r1GpioId = "BCM6",
Numpad(c1GpioId = "BCM27",
c2GpioId = "BCM17",
c3GpioId = "BCM22",
r1GpioId = "BCM12",
r2GpioId = "BCM21",
r3GpioId = "BCM20",
r4GpioId = "BCM19"
r4GpioId = "BCM16"
)
.apply {
keyListener = { keyEvent ->
Expand Down
13 changes: 12 additions & 1 deletion numpad/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ dependencies {
}
```

### Connection
### Hardware Setup
<img src="https://gitlab2.polidea.com/pawel.byszewski/android_things_drivers/raw/ba0ce3a6ff706d31a2d61f640e5cfb322328fee5/numpad/readme/numpad_wiring.jpg" width="342" height="389" /><br/>
Every `GPIO` connected to row on a numpad MUST be [pulled-up](https://developer.android.com/things/hardware/hardware-101.html#pull-ups_and_pull-downs) to 3.3V


Expand All @@ -27,6 +28,16 @@ Every `GPIO` connected to row on a numpad MUST be [pulled-up](https://developer.
```kotlin
import com.polidea.androidthings.driver.numpad.NumpadDriver

// select gpio pins on your board for columns(c) and rows(r)

val c1GpioPinName = "BCM27"
val c2GpioPinName = "BCM17"
val c3GpioPinName = "BCM22"
val r1GpioPinName = "BCM12"
val r2GpioPinName = "BCM21"
val r3GpioPinName = "BCM20"
val r4GpioPinName = "BCM16"

// Access the Button and listen for events:

val numpad = Numpad(c1GpioId = c1GpioPinName,
Expand Down
Binary file added numpad/readme/numpad_wiring.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 19 additions & 3 deletions uln2003/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ ULN2003 driver for Android Things
================================

This driver supports ULN2003 driver with 28BYJ-48 Stepper Motor.<br/>
[This](http://42bots.com/tutorials/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno/) tutorial helped us developing our driver.
[This](http://42bots.com/tutorials/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno/) tutorial helped us developing our driver.<br/>
<br/>
<img src="http://gitlab2.polidea.com/pawel.byszewski/android_things_drivers/raw/941597d1c24d220d158788d8ca5199781cd9d2f1/uln2003/readme/ULN2003.jpg" width="298" height="293" />

How to use the driver
---------------------
Expand All @@ -18,14 +20,21 @@ dependencies {
}
```

### Connection
Connect all four "in" pins on uln2003 driver into GPIOs available on your board
### Hardware Setup
Connect all four "in" pins on uln2003 driver into GPIOs available on your board.

### Sample usage of high level Stepper Motor Driver

```kotlin
com.polidea.androidthings.driver.uln2003.motor.ULN2003StepperMotor

// select gpio pins on your board for uln2003 input pins

val in1Pin = "BCM4"
val in2Pin = "BCM17"
val in3Pin = "BCM27"
val in4Pin = "BCM22"

val stepper = ULN2003StepperMotor(in1GpioId = in1Pin,
in2GpioId = in2Pin,
in3GpioId = in3Pin,
Expand Down Expand Up @@ -59,6 +68,13 @@ Remember, if you close ULN2003StepperMotor during the execution process you'll b
```kotlin
package com.polidea.androidthings.driver.uln2003.driver.ULN2003

// select gpio pins on your board for uln2003 input pins

val in1Pin = "BCM4"
val in2Pin = "BCM17"
val in3Pin = "BCM27"
val in4Pin = "BCM22"

val uln2003 = ULN2003(in1GpioId = in1Pin,
in2GpioId = in2Pin,
in3GpioId = in3Pin,
Expand Down
Binary file added uln2003/readme/ULN2003.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a31f114

Please sign in to comment.