https://github.com/matzeema/wiring_pi_soft_pwm
Dart implementation of the Wiring Pi Software PWM library.
https://github.com/matzeema/wiring_pi_soft_pwm
dart ffi pwm wiring-pi
Last synced: about 2 months ago
JSON representation
Dart implementation of the Wiring Pi Software PWM library.
- Host: GitHub
- URL: https://github.com/matzeema/wiring_pi_soft_pwm
- Owner: matzeema
- License: mit
- Created: 2021-02-15T20:15:00.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-10T07:18:09.000Z (over 2 years ago)
- Last Synced: 2025-02-08T16:39:40.328Z (4 months ago)
- Topics: dart, ffi, pwm, wiring-pi
- Language: Dart
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Wiring Pi Software PWM
Dart implementation of the Wiring Pi Software PWM library.
I mainly created this package for one of my own projects, so I haven't done a lot of testing yet. But I still hope this makes the creation of your flutter-pi app (or whatever you create) easier.
## Installing Wiring Pi
Visit this [guide](http://wiringpi.com/download-and-install/) to install the Wiring Pi library on your Raspberry Pi. If your are using a Raspberry Pi 4B you might also check this [post](http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/).
The library (`.so` file) should be located under `/usr/lib/libwiringPi.so`.
## Using the package
First create the `SoftPwmGpio`. It takes the the pin of the GPIO. Afterwards call the `setup` method.
```dart
final pwmGpio = SoftPwmGpio(12);
pwmGpio.setup();
```The `SoftPwmGpio` is now setup and ready to use. You can use the `write` method to set the PWM duty cycle. The method only allows values between 0 and 100.
```dart
pwmGpio.write(50);
```