AAIMI GPIO is a web-based control interface for the Raspberry Pi and Arduino. Check out the tutorials below.
Using PWM with AAIMI GPIO
Today we'll use AAIMI GPIO to run a bi-directional PWM motor and a PWM LED.
I have a motor hooked to GPIO27 and GPIO22 via a motor-controller. Let's get it running.
Click the button for your first motor pin, in my case GPIO27, and press Change setting.
Name your motor and Select PWM Motor
Just like the standard input from the previous article, choose a default state for your motor, Low or High
Select 'Manually switch on and off'
Now you can enter the motor-specific details for the pin.
In my case the second pin number for my motor is 22.
I've entered zero for my starting speed. You can enter any speed and the motor will start at that speed when you switch it on. One issue with non-zero starting speed at the moment, however is the speed adjustment slider in the speed tab will display zero until you adjust the speed. After that it will reflect the actual speed. I'll fix that in the next version.
You should now see the motor pin set as output in the pin list.
In the Run tab I can now see my motor beneath the LED and PIR sensor I added in the previous article.
If I click the motor heading and press On, the motor will power on and the Speed window appears.
In my case the motor is not yet spinning because I chose zero as the starting speed. If I slide the speed slider to the right, the motor revs up to the chosen speed.
If you click on the Backwards button the motor will stop for two seconds to allow it to stop spinning. It will then start in the opposite direction at its default speed.
The steps for using a PWM LED are almost identical to using a motor. The main difference is not needing to enter the second pin, because a LED only needs one pin.
Once again, click on the pin for your LED and press Change stettings.
This time select PWM Output.
As with all outputs, choose the default state and type of control.
Enter the starting PWM speed, or brightness for your LED, then click finish.
The speed control for the LED brightness is the same speed slider used for the motors, just without the Direction buttons.