Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- using Microsoft.SPOT;
- using Microsoft.SPOT.Presentation;
- using Microsoft.SPOT.Presentation.Controls;
- using Microsoft.SPOT.Presentation.Media;
- using Microsoft.SPOT.Touch;
- using Gadgeteer.Networking;
- using GT = Gadgeteer;
- using GTM = Gadgeteer.Modules;
- using Gadgeteer.Modules.GHIElectronics;
- namespace Gadgeteer_LED_03
- {
- public partial class Program
- {
- // This method is run when the mainboard is powered up or reset.
- void ProgramStarted()
- {
- /*******************************************************************************************
- Modules added in the Program.gadgeteer designer view are used by typing
- their name followed by a period, e.g. button. or camera.
- Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
- button.ButtonPressed +=<tab><tab>
- If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
- GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
- timer.Tick +=<tab><tab>
- timer.Start();
- *******************************************************************************************/
- // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
- Debug.Print("Program Started");
- // We can create all sorts of holders that contain things that might vary during the operation of the instructions
- // Create a simple number counter to look at to see where we are
- int incrementalCounter = 0;
- // A condition loop to check the number against
- // Carry on looping while the value of incrementalCounter is less than 255
- while (incrementalCounter < 255)
- {
- led.SetBlueIntensity(incrementalCounter);
- led1.SetBlueIntensity(incrementalCounter);
- Thread.Sleep(500);
- // Some maths to add an increase to the counter
- incrementalCounter = incrementalCounter + 1;
- //this can be written quickly as "incrementalCounter++"
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment