Skip to content

Commit

Permalink
improve after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fallais committed Feb 12, 2022
1 parent 448b779 commit 26bdb4c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,43 @@ coop:
door:
openening_duration: "65s"
closing_duration: "60s"
pin_1A: 23
pin_1B: 24
pin_enable1: 25
motor:
type: l293d
pin_1A: 23
pin_1B: 24
pin_enable1: 25
cameras:
outdoor: http://185.39.101.26/mjpg/video.mjpg
indoor: http://187.157.229.132/mjpg/video.mjpg
```
#### Motor types
Actually, two types of motor can be used :
```yaml
door:
openening_duration: "65s"
closing_duration: "60s"
motor:
type: l293d
pin_1A: 23
pin_1B: 24
pin_enable1: 2
```
```yaml
door:
openening_duration: "65s"
closing_duration: "60s"
motor:
type: bts7960
forward_PWM: 23
backward_PWM: 24
forward_enable: 2
backward_enable: 3
```
#### Modes and values
Two modes are available :
Expand Down
2 changes: 2 additions & 0 deletions internal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ func Run(cmd *cobra.Command, args []string) {
motor = l293d.NewL293D(viper.GetInt("door.motor.pin_1A"), viper.GetInt("door.motor.pin_1B"), viper.GetInt("door.motor.pin_enable1"))
case "bts7960":
motor = bts7960.NewBTS7960(viper.GetInt("door.motor.forward_PWM"), viper.GetInt("door.motor.backward_PWM"), viper.GetInt("door.motor.forward_enable"), viper.GetInt("door.motor.backward_enable"))
default:
logrus.Fatalln("Motor type does not exist")
}
logrus.Infoln("Successfully created the motor")

Expand Down

0 comments on commit 26bdb4c

Please sign in to comment.