NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#if defined(__AVR_ATmega32U4__)
#define TIMER1_A_PIN 9
#define TIMER1_B_PIN 10
#define TIMER1_C_PIN 11
#define TIMER1_ICP_PIN 4
#define TIMER1_CLK_PIN 12
#define TIMER3_A_PIN 5
#define TIMER3_ICP_PIN 13
#endif

inline void setupPWM16() __attribute__((always_inline));
inline void analogWrite16(uint8_t pin, uint16_t val) __attribute__((always_inline));

void setup(void)
{
Serial.begin(115200);
pinMode(A0, INPUT);
setupPWM16();

}
int duty = 0;
int duty256 = 0;
void loop(void)
{
duty = analogRead(A0);
duty256 = map(duty,0,1000,0,511);
Serial.println(duty256);
analogWrite(3,duty256);
analogWrite16(10, duty256);
}

void setupPWM16() {
OCR1A = 0;
OCR1B = 0;
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);

ICR1 = 511;

TCCR1A = 0xA0; /*COM1A1 and COM1B1 registers set*/

TCCR1B = 0x11; /*mode 8 set: WGM13 set clock select CS10 set*/

}

/* 16-bit version of analogWrite(). Works only on pins 9 and 10. */
void analogWrite16(uint8_t pin, uint16_t val)
{
if (pin == TIMER1_A_PIN) OCR1A = val;
else if (pin == TIMER1_B_PIN) OCR1B = val;
else if (pin == TIMER1_C_PIN) OCR1C = val;
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.