Category : pwm

I am trying to create a function that would build a list of accelerating pulse width durations: The problem would have two variables: The number of pulses: X The timespan of the sequence: Y A number to represent the the curve, maybe starting at 0 for linear growth, or 1 for exponential growth I have ..

Read more

I want to start the LED gradually with dimming by using PWM. And then once at a ChangeDutyCycle(100) I want it to remain on GPIO.output(led, GPIO.HIGH). import RPi.GPIO as GPIO import time led = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(led, GPIO.OUT) def dim(): green = GPIO.PWM(led, 100) green.start(0) pause_time = 0.010 for i in range(0, 100+1): green.ChangeDutyCycle(i) time.sleep(pause_time) ..

Read more

I am using an MG 996R servo connected to a raspberry pi and an external power supply. I am using this code: import RPi.GPIO as GPIO import time servoPIN = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(servoPIN, GPIO.OUT) p = GPIO.PWM(servoPIN, 50) # GPIO 17 for PWM with 50Hz p.start(2.5) # Initialization try: while True: p.ChangeDutyCycle(5) time.sleep(0.5) p.ChangeDutyCycle(7.5) time.sleep(0.5) ..

Read more

I am trying to determine the amino acid frequency at each position from a fasta file of aligned sequences. Here is what my data looks like (66 total sequences): LKASLTCSPHRQRRSTKDNF VQDTHPSPTNRSKRNLKMEI FYIKITNGTRRFRRSITENV ISLLLTNPSSRRKRSLIEDL FYIKITNGTRRFRRSITESV ISLFLTTPSSPRRRSFIEDL ISLLLTTPSSPRRRSFIEDL FYIKIINGTRRSRRSITGNV … My code looks like this: from Bio import SeqIO def convert_sequences(input_file): with open(input_file) as file: for seq ..

Read more