-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
analogWrite to PWM pins not working #3
Comments
Have you tried sample_analogwrite.py? It works for me. Why are you doing val = object.method() anyway? Try my_board.analogWrite(11,255) instead. |
Thank you for responding. Yes, I tried sample_analogwrite.py, but the program gets stuck on b.analogWrite(pin, brightness) line. Also, I am not sure why there are two output statements there. analogWrite method returns a boolean indicating completion. I am just retrieving it be able to see if it was completed properly. |
Hm... That's odd. I'm using this lib in one of my projects for several months now (https://github.com/n0w/rgblamp) with no complaints at all. I'm at work now, so I can't test anything but just in case... What version of python are you using? Mine was 2.7 under debian linux |
I am using python 2.5 under windows. I think I may have found a work around (I still need to check if it works properly). Looks like it was getting stuck at " while(self.__getData()!="what"): |
import the lib
from arduino import Arduino
import time
specify the port as an argument
my_board = Arduino('COM5')
print my_board
declare output pins as a list/tuple
my_board.output([9,10,11])
perform operations
i=0
while(i<10):
print 'Writing Value'
val = my_board.analogWrite(11,255)
time.sleep(10)
i+=1
my_board.close()
This code hangs after 'Writing Value'
The text was updated successfully, but these errors were encountered: