Es7evam

Arduino

Dec 2nd, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. pinmode(nropino, OUTPUT); // ou input
  2.  
  3.  
  4. #PWM - http://forum.arduino.cc/index.php?topic=117425.0
  5.  
  6. InitTimers() //Initializes all timers. Needs to be called before changing the timers frequency or setting the duty on a pin
  7. InitTimersSafe() //Same as InitTimers() except timer 0 is not initialized in order to preserve time keeping functions
  8. pwmWrite(uint8_t pin, uint8_t val) //Same as 'analogWrite()', but it only works with initialized timers. Continue to use analogWrite() on uninitialized timers
  9. SetPinFrequency(int8_t pin, int32_t frequency) //Sets the pin's frequency (in Hz) and returns a bool for success
  10.  
  11. Timer1_GetFrequency() //Gets the timer's frequency in Hz
  12. Timer1_SetFrequency(int frequency) //Sets the timer's frequency in Hz
  13. Timer1_GetPrescaler() //Gets the value (not bits) of the prescaler. Don't know what this means? Don't worry about it, just use SetFrequency(int frequency)
  14. Timer1_SetPrescaler(enum value) // Sets the prescaler*
  15. Timer1_GetTop() //Gets the timer register's maximum value
  16. Timer1_SetTop(int top) //Sets the timer register's maximum value
  17. Timer1_Initialize() //Initializes the timer
Add Comment
Please, Sign In to add comment