Page 1 of 1

SparkFun SAMD21 Mini Breakout Analog Write

Posted: Mon Dec 21, 2015 9:24 am
by jelanier
I just received my "SparkFun SAMD21 Mini Breakout" and found that bit does not function properly with analogWrite.
If you select **SparkFun SAMD21 Dev Breakout** in the Arduino IDE instead, it works fine. I wonder if they loaded the wrong firmware in the mini? I am not sure why it's firmware would be different. There is not much going on on these breakout boards.

Try this with each board selection (dev breakout and mini breakout):
Code: Select all
/*
  LEDRamp SAMD21 TEST
  James Lanier
  
 */
int LED13=13;int LED10=10;

void setup() 
{
  analogWriteResolution(10) ; //10bit=1023max,12bit=4095max
}


void loop() 
{
  for(int val=1023;val>0;val--)
  {
    analogWrite(LED13, val/10);   // Limit Range(drives gate of FET for LED)
    analogWrite(LED10, val);      // Full Range
    delay(2);
  }
  
  delay(50);
    
  for(int val=0;val<1024;val++)
  {
    analogWrite(LED13, val/10);   // Limit Range(drives gate of FET for LED)
    analogWrite(LED10, val);      // Full Range
    delay(2); 
  }
  
  delay(50);
  
}
Thanks,

Jim

Re: SparkFun SAMD21 Mini Breakout Analog Write

Posted: Mon Dec 21, 2015 10:14 am
by jelanier
I found an issue in the boards.txt file.

The issue is with "samd21_dev.build.variant=" When I change the mini to read "samd21_dev.build.variant=arduino_zero" instead of "samd21_mini.build.variant=SparkFun_SAMD_Mini" it works fine.

Thanks,

Jim