Anonymous

Project:YAAC: Difference between revisions

From London Hackspace Wiki
Line 185: Line 185:


SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0480", MODE:="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0480", MODE:="0666"
=== Serial communication over USB ===
Working ~ write up to follow
=== PWM ===
To get PWM to dim/brighten your LEDs, pick a PWM enabled pin and change the value:
// as per datasheet
byte PWM_pin = 15;
// set to output
pinMode(PWM_pin, OUTPUT);
// write a compass angle, as an example
analogWrite(PWM_pin, angle);
It so happens that angle is only varying between 0 and +180. The value, as per arduino.cc documentation, varies between 0 and 255.


== Potential improvements ==
== Potential improvements ==
Anonymous user