Skip to content
Snippets Groups Projects
Commit 9de9b187 authored by Thibaut VIARD's avatar Thibaut VIARD
Browse files

Adding PWM validation project

parent 7787e936
No related branches found
No related tags found
No related merge requests found

Microsoft Visual Studio Solution File, Format Version 11.00
# Atmel Studio Solution File, Format Version 11.00
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "test", "test.cppproj", "{B3F859AD-E162-4C2F-9684-EAC6932FEC80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Release|ARM = Release|ARM
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B3F859AD-E162-4C2F-9684-EAC6932FEC80}.Debug|ARM.ActiveCfg = Debug|ARM
{B3F859AD-E162-4C2F-9684-EAC6932FEC80}.Debug|ARM.Build.0 = Debug|ARM
{B3F859AD-E162-4C2F-9684-EAC6932FEC80}.Release|ARM.ActiveCfg = Release|ARM
{B3F859AD-E162-4C2F-9684-EAC6932FEC80}.Release|ARM.Build.0 = Release|ARM
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
/*
Copyright (c) 2014 Arduino. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "Arduino.h"
static uint8_t brightness = 0; // how bright the LED is
static int fadeAmount = 5; // how many points to fade the LED by
void setup( void )
{
for ( int i=2 ; i < 14 ; i++ )
{
pinMode( i, OUTPUT ) ;
}
Serial5.begin( 115200 ) ; // Output to EDBG Virtual COM Port
Serial5.println( "test") ;
Serial5.println( brightness ) ;
}
void loop( void )
{
Serial5.println( brightness ) ;
for ( int i=2 ; i < 14 ; i++ )
{
analogWrite( i, brightness ) ;
}
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount ;
// reverse the direction of the fading at the ends of the fade:
if ( brightness == 0 || brightness == 255 )
{
fadeAmount = -fadeAmount ;
}
// wait for 30 milliseconds to see the dimming effect
delay( 30 ) ;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment