Darien Figueroa / Mbed 2 deprecated repo3

Dependencies:   mbed MAX14720 MAX30205 USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Form1.cs Source File

Form1.cs

00001 using System;
00002 using System.Collections.Generic;
00003 using System.ComponentModel;
00004 using System.Data;
00005 using System.Drawing;
00006 using System.Linq;
00007 using System.Text;
00008 using System.Threading.Tasks;
00009 using System.Windows.Forms;
00010 using Maxim.Utility;
00011 
00012 namespace FileLogExample
00013 {
00014     public partial class Form1 : Form
00015     {
00016         FileLog fileLog = new FileLog();
00017         bool fileSelected = false;
00018         int count = 0;
00019         
00020         public Form1()
00021         {
00022             InitializeComponent();
00023         }
00024 
00025         private void button1_Click(object sender, EventArgs e)
00026         {
00027             try
00028             {
00029                 fileSelected = fileLog.SelectCSVFile("fileLogExample");
00030                 if (fileSelected)
00031                     MessageBox.Show("File Select successful");
00032                 else
00033                     MessageBox.Show("File Select failed");
00034             }
00035             catch(System.IO.IOException ex)
00036             {
00037                 MessageBox.Show(ex.Message, "File Select Failed");
00038             }
00039         }
00040 
00041         private void button2_Click(object sender, EventArgs e)
00042         {
00043             if (fileSelected == true)
00044             {
00045                 fileLog.WriteLine("Writing Line " + count++);
00046             }
00047         }
00048     }
00049 }