mirror of
git://soft.sys114.com/WiringPi2-Python
synced 2026-02-04 15:30:35 +09:00
Fixed include in piNes.c, two new examples. Nokia LCD one doesnt work
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
#include <wiringPi.h>
|
||||
#include "wiringPi.h"
|
||||
|
||||
#include "piNes.h"
|
||||
|
||||
|
||||
@@ -11,5 +11,5 @@ wiringpi2.mcp23017Setup(pin_base,i2c_addr)
|
||||
for pin in pins:
|
||||
wiringpi2.pinMode(pin,1)
|
||||
wiringpi2.digitalWrite(pin,1)
|
||||
wiringpi2.delay(1000)
|
||||
wiringpi2.digitalWrite(pin,0)
|
||||
# wiringpi2.delay(1000)
|
||||
# wiringpi2.digitalWrite(pin,0)
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
# Pulsates an LED connected to GPIO pin 1 with a suitable resistor 4 times using softPwm
|
||||
# softPwm uses a fixed frequency
|
||||
import wiringpi2
|
||||
|
||||
OUTPUT = 1
|
||||
|
||||
PIN_TO_PWM = 1
|
||||
|
||||
wiringpi2.wiringPiSetup()
|
||||
wiringpi2.pinMode(1,1)
|
||||
wiringpi2.softPwmCreate(1,0,100)
|
||||
wiringpi2.pinMode(PIN_TO_PWM,OUTPUT)
|
||||
wiringpi2.softPwmCreate(PIN_TO_PWM,0,100) # Setup PWM using Pin, Initial Value and Range parameters
|
||||
|
||||
for time in range(0,4):
|
||||
for brightness in range(0,100):
|
||||
wiringpi2.softPwmWrite(1,brightness)
|
||||
for brightness in range(0,100): # Going from 0 to 100 will give us full off to full on
|
||||
wiringpi2.softPwmWrite(PIN_TO_PWM,brightness) # Change PWM duty cycle
|
||||
wiringpi2.delay(10) # Delay for 0.2 seconds
|
||||
for brightness in reversed(range(0,100)):
|
||||
wiringpi2.softPwmWrite(1,brightness)
|
||||
wiringpi2.softPwmWrite(PIN_TO_PWM,brightness)
|
||||
wiringpi2.delay(10)
|
||||
|
||||
Reference in New Issue
Block a user