Hallo!
Mit dem folgenden Code erzeuge ich mir einen Impuls am Pin 3 meines Arduino uno.
Ich möchte jatzt aber auch noch auf einem zweiten Pin einen um 180° phasenverschobenen Impuls erzeugen.
Kann mir da bitte jemand weiterhelfen?
Code:
// A sketch that creates an 250 kHz 6-bit resolution PWM with varying duty cycle
#include <avr/io.h>
#include <util/delay.h>
void setup()
{
pinMode(3, OUTPUT); // Output pin for OCR2B
// Set up the 250 kHz output
TCCR2A = bit(COM2A1) | bit(COM2B1) | bit(WGM21) | bit(WGM20);
TCCR2B = bit(WGM22) | bit(CS20);
OCR2A = 63;
OCR2B = 0;
}
void loop()
{
}
Viele Dank!
Lesezeichen