Guest User

Untitled

a guest
Apr 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.72 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace USB_Plaatje_Digitaal
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         private USBboard myBoard;
  15.         private Timer time;
  16.  
  17.         public bool Run = true;
  18.         private byte LedData = 0;
  19.         private byte MotorData = 0;
  20.  
  21.         public Form1()
  22.         {
  23.             InitializeComponent();
  24.             myBoard = new USBboard(this);
  25.             time = new Timer();
  26.             time.Interval = 1;
  27.             time.Tick += new EventHandler(time_Tick);
  28.             time.Enabled = true;
  29.  
  30.         }
  31.         void time_Tick(object sender, EventArgs e)
  32.         {
  33.             toonAlleBitpatronen();
  34.         }
  35.  
  36.         private void Form1_Load(object sender, EventArgs e)
  37.         {
  38.             // Voorbeeld();
  39.             // toonBitpatroon(200);
  40.             // toonAlleBitpatronen();
  41.             // teller();
  42.             // geefDrukknopTijd();
  43.             // progressBarLSB();
  44.             // progressBarLSBLoop();
  45.             // progressBarMSB();
  46.             // progressBarMSBLoop();
  47.             // motorSwitch();
  48.             // motorSpeed();
  49.             // testSpeed();
  50.             // regelNivo();
  51.         }
  52.         private void Voorbeeld()
  53.         {
  54.             myBoard.SetLed(255);
  55.         }
  56.         private void toonAlleBitpatronen()
  57.         {
  58.             if (myBoard.GetSwitch())
  59.             {
  60.                 for (byte i = 0; i < 255; i++)
  61.                 {
  62.                     myBoard.SetLed(i);
  63.                 }
  64.                 time.Enabled = false;
  65.             }
  66.         }
  67.  
  68.  
  69.  
  70.     }
  71. }
Add Comment
Please, Sign In to add comment