Open didasy opened 7 years ago
When using Firmata pins A4 and A5 are used by the i2c interface. I suggest using pins A0 thru A3.
Hope that helps!
I am using digital pin 5 (as it says it has PWM support), not analog A5. Or are you saying they are connected?
OK. I think you should use pwmWrite()
since it will do the mapping you expect (digital pins).
analogWrite()
does the same thing as analogRead()
which takes an analog pin number as a param.
Hold on, I thought analogWrite()
accept PWM value (0-255) as param? What does it do exactly?
And I think I will try using pwmWrite()
instead, thanks for the pointer.
The difference is that analogWrite()
when you pass "5" as a param, it means pin A5. With pwmWrite()
the param "5" means pin D5.
I'm currently trying to do analogWrite(255) to pin 5 of an Arduino Uno, but it doesn't give me voltage reading at all. (it toggle the LED though)
I've tried it using regular arduino code directly on the board and at 255 it gives me around 4.8v.
This is my code:
this is the config part
and this is the work code