Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sketch uses 1,708 bytes (20%) of program storage space. Maximum is 8,192 bytes.
- Global variables use 68 bytes (13%) of dynamic memory, leaving 444 bytes for local variables. Maximum is 512 bytes.
- */
- #include "PWM/PWM.h"
- int val(0);
- void setup()
- {
- pinMode(0, OUTPUT);
- pinMode(1, OUTPUT);
- pwm.set(1,'a',32000,5,false);
- pwm.set(1,'a',32000,5,true);
- pwm.start();
- }
- void loop()
- {
- val = analogRead(3)/10;
- val = map(val, 0, 100, 0, 100);
- if(val <= 100)
- {
- // The duty cycle on this is broken and so are the pins for 0 & 1
- pwm.set(0,'a',32000,val,false);
- pwm.set(1,'a',32000,val,true);
- }
- }
Add Comment
Please, Sign In to add comment