Hey guys, I recently got my hands on an Arduino Due and I'm trying to familiarize myself with the various functions and the programming.
Now, the pins 2-13 are supposed to have PWM so I tried fading-in/out LEDs from these pins. I cannot use PWM with pins 6-7, but I can use the digitalWrite to blink the LEDs in those pins.
This is the code I am running:
int j;
int del=2;
int k=1;
void setup()
{
pinMode(k, OUTPUT);
}
void loop() {
for(j=0; j<=256; j++)
{
analogWrite(k, j);
delay(del);
}
for(j=256; j>=0; j--)
{
analogWrite(k, j);
delay(del);
}
}
Am I doing something wrong? Is it possible that the board is defective? Or perhaps that I've managed to somehow damage it?