SparkFun SAMD21 Mini Breakout Analog Write

Have questions about a SparkFun product or board? This is the place to be.

Moderators: phalanx, TS-Tim

Post Reply
jelanier
Posts: 10
Joined: Sun Nov 22, 2015 5:34 am

SparkFun SAMD21 Mini Breakout Analog Write

Post by jelanier » Mon Dec 21, 2015 9:24 am

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

jelanier
Posts: 10
Joined: Sun Nov 22, 2015 5:34 am

Re: SparkFun SAMD21 Mini Breakout Analog Write

Post by jelanier » Mon Dec 21, 2015 10:14 am

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

Post Reply