{"id":34470,"date":"2024-04-26T22:56:00","date_gmt":"2024-04-26T22:56:00","guid":{"rendered":"http:\/\/localhost\/branding\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/"},"modified":"2024-04-26T22:56:00","modified_gmt":"2024-04-26T22:56:00","slug":"lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino","status":"publish","type":"post","link":"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/","title":{"rendered":"lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino"},"content":{"rendered":"<p>LAB REPORT #2Name <\/p>\n<p>Date <\/p>\n<p>Course Code <\/p>\n<p>Table of contents<\/p>\n<p>AbstractPage 3<\/p>\n<p>Introduction<\/p>\n<p>Sin Wave Generator Page 4<\/p>\n<p>Square Wave GeneratorPage 5-6<\/p>\n<p>Saw tooth Wave GeneratorPage 7<\/p>\n<p>ConclusionPage 8<\/p>\n<p>Abstract<\/p>\n<p>The experiment detailed herein was done in classroom. The purpose was to project all the waves on oscilloscope provide by the code teacher. The teacher had explained and showed us Square Wave, Sine Wave and Triangle\/Saw tooth Wave. Through C#, the code was embedded into the Net Duino. The circuit that had been made earlier was connected to the Oscilloscope. The three waves were seen in the attacked oscilloscope.  <\/p>\n<p>Introduction<\/p>\n<p>The lab report commences by the introduction of the three above mentioned waves. All the waves were generated using the same voltages. The oscilloscope helps to take screen shot of the waves. Additionally, each wave was represented using a code. The Waves are presented as show through the code placed in NetDuino. <\/p>\n<p>Sine Wave Generator<\/p>\n<p>using System;<\/p>\n<p>using System.Net;<\/p>\n<p>using System.Net.Sockets;<\/p>\n<p>using System.Threading;<\/p>\n<p>using Microsoft.SPOT;<\/p>\n<p>using Microsoft.SPOT.Hardware;<\/p>\n<p>using SecretLabs.NETMF.Hardware;<\/p>\n<p>using SecretLabs.NETMF.Hardware.NetduinoPlus;<\/p>\n<p>\/\/ Gives a PWM output that, its duty cycle varies as a function of a sine wave.<\/p>\n<p>\/\/It is like DAC. To see a Sine wave on scope pass the output through a low pass RC filter.<\/p>\n<p>\/\/Also if you connect the output to a LED its intensity varies like a sine wave.<\/p>\n<p>namespace NetduinoPlusPWM_SineWave{<\/p>\n<p>    public class Program<\/p>\n<p>    {<\/p>\n<p>        public static void Main()<\/p>\n<p>        {<\/p>\n<p>            int value = 0;<\/p>\n<p>            int degree = 0;<\/p>\n<p>            \/\/PWM pwm = new PWM(Pins.GPIO_PIN_D5);<\/p>\n<p>            PWM pwm = new PWM(Cpu.PWMChannel.PWM_3, 500, 0.5, false);\/\/PIN D10<\/p>\n<p>            while (true)<\/p>\n<p>            {<\/p>\n<p>                degree += 1;  \/\/ lets go from 0 to 360 degree over and over<\/p>\n<p>                degree %= 360;  \/\/remainder of 0-359<\/p>\n<p>                \/\/ sin() function returns an integer from -1000 to 1000. We need to shift it up by a 1000 to become positive<\/p>\n<p>                value = 1000 + Microsoft.SPOT.Math.Sin(degree);  \/\/ value is between 0 and 2000<\/p>\n<p>                uint nValue = (uint)((value) \/ 20); \/\/ lets scale value from 0-2000 to 0-100. The percent duty cycle is nValue                pwm.DutyCycle = (((float)(nValue))\/100);   \/\/ set the duty-cycle to a specific nvalue                \/\/Thread.Sleep(10);<\/p>\n<p>                \/\/ Debug.Print(degree.ToString());<\/p>\n<p>                \/\/ Debug.Print(value.ToString());<\/p>\n<p>                \/\/ Debug.Print(nValue.ToString());<\/p>\n<p>            }<\/p>\n<p>        }<\/p>\n<p>    }<\/p>\n<p>-27622516383000    } <\/p>\n<p>Description<\/p>\n<p>In this starting wave generator which is Sine wave, the section of the law indicates the real code of the wave and also a screen shot as obtained from Oscilloscope. <\/p>\n<p>Square Wave Generator<\/p>\n<p>using System;<\/p>\n<p>using System.Net;<\/p>\n<p>using System.Net.Sockets;<\/p>\n<p>using System.Threading;<\/p>\n<p>using Microsoft.SPOT;<\/p>\n<p>using Microsoft.SPOT.Hardware;<\/p>\n<p>using SecretLabs.NETMF.Hardware;<\/p>\n<p>using SecretLabs.NETMF.Hardware.NetduinoPlus;<\/p>\n<p>namespace NetduinoPlusApplication1<\/p>\n<p>{<\/p>\n<p>    public class Program<\/p>\n<p>    {<\/p>\n<p>         static long DelayTicks;<\/p>\n<p>        static long ticks;<\/p>\n<p>        \/\/long DelayTicks = 500*10; \/\/#ticks for 500us<\/p>\n<p>       static void delay(long  duration)<\/p>\n<p>            {<\/p>\n<p> DelayTicks = duration * 10;   \/\/period and measured in microseconds<\/p>\n<p>                ticks = Utility.GetMachineTime().Ticks; \/\/ capture current time and put it in ticks<\/p>\n<p>                while ((Utility.GetMachineTime().Ticks &#8211; ticks) &lt; DelayTicks) ;<\/p>\n<p>           }<\/p>\n<p>        public static void Main()<\/p>\n<p>        {       <\/p>\n<p>       \/\/ Make ramp wave <\/p>\n<p>OutputPort led = new OutputPort(Pins.GPIO_PIN_D0, false);<\/p>\n<p>            long period = 1000;   \/\/1=1usec<\/p>\n<p>            long lowTime=0;<\/p>\n<p>          while (true)<\/p>\n<p>            {<\/p>\n<p>                lowTime+=20;           \/\/increase the low time part of the pulse<\/p>\n<p>                if (lowTime &gt;= period)<\/p>\n<p>                \/\/ turn LED ON<\/p>\n<p>                led.Write(true);<\/p>\n<p>                \/\/ let it be ON <\/p>\n<p>               delay(period &#8211; lowTime);   \/\/high time is period \u2013 lowTime<\/p>\n<p>\/\/ turn LED OFF and let it stay OFF <\/p>\n<p>                led.Write(false);<\/p>\n<p>                delay(lowTime);<\/p>\n<p>                   lowTime = 0;<\/p>\n<p>        }<\/p>\n<p>    }<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>033274000<\/p>\n<p>Description <\/p>\n<p>In this second wave generator, the real code of Sine waves and the screen shot obtained from oscilloscope is shown. <\/p>\n<p>Saw Tooth Wave Generator<\/p>\n<p>using System;<\/p>\n<p>using System.Net;<\/p>\n<p>using System.Net.Sockets;<\/p>\n<p>using System.Threading;<\/p>\n<p>using Microsoft.SPOT;<\/p>\n<p>using Microsoft.SPOT.Hardware;<\/p>\n<p>using SecretLabs.NETMF.Hardware;<\/p>\n<p>using SecretLabs.NETMF.Hardware.NetduinoPlus;<\/p>\n<p>namespace NetduinoPlusApplication1<\/p>\n<p>{<\/p>\n<p>    public class Program<\/p>\n<p>    {<\/p>\n<p>   public static void Main()<\/p>\n<p> { \/\/uses hardware pwm.  LED is connected to PIN D10 (PWM_3) and a grounded resisior of 220<\/p>\n<p>            double dutyCycle = 0;<\/p>\n<p> \/\/at port PWM3, freq=1000hz, duty cycle=0.5 and output not inverted.<\/p>\n<p>            var  pwm = new PWM(Cpu.PWMChannel.PWM_3, 1000, 0.5, false);\/\/PIN D10<\/p>\n<p>            var button = new InputPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled);<\/p>\n<p>            pwm.Start();<\/p>\n<p>            while (true)  \/\/keep polling<\/p>\n<p>{<\/p>\n<p>if (button.Read() == true)      \/\/if button pressed<\/p>\n<p> {<\/p>\n<p>if (dutyCycle &lt; 1)<\/p>\n<p>dutyCycle = dutyCycle + .05;  \/\/as long as the button pressed increment the duty cycle<\/p>\n<p>                    else dutyCycle = 0;<\/p>\n<p>                    pwm.DutyCycle = dutyCycle;<\/p>\n<p>                    Thread.Sleep(300);  \/\/to avoid multiple read of the key pressed<\/p>\n<p>                }<\/p>\n<p>            }<\/p>\n<p>        }<\/p>\n<p>        }<\/p>\n<p>    }<\/p>\n<p>Description <\/p>\n<p>In the last and third section, Saw tooth wave is shown. This section of the experiment shows the actual Saw tooth wave code and screen shot as indicated through Oscilloscope. <\/p>\n<p>Conclusion<\/p>\n<p>At the end of the experiment the conclusion was that regardless of similar voltages across all the three waves, suppose there is a change in frequencies of the waves, the way waves are presented in oscilloscope can differ. Also, I observed that minus having the correct code into the NetDuino. The projection and the circuit would not be accurate as would be expected. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>LAB REPORT #2Name Date Course Code Table of contents AbstractPage 3 Introduction Sin Wave Generator Page 4 Square Wave GeneratorPage<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-34470","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino - sheilathewriter<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino - sheilathewriter\" \/>\n<meta property=\"og:description\" content=\"LAB REPORT #2Name Date Course Code Table of contents AbstractPage 3 Introduction Sin Wave Generator Page 4 Square Wave GeneratorPage\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/\" \/>\n<meta property=\"og:site_name\" content=\"sheilathewriter\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-26T22:56:00+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/\",\"url\":\"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/\",\"name\":\"lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino - sheilathewriter\",\"isPartOf\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#website\"},\"datePublished\":\"2024-04-26T22:56:00+00:00\",\"author\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab\"},\"breadcrumb\":{\"@id\":\"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/sheilathewriter.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#website\",\"url\":\"https:\/\/sheilathewriter.com\/blog\/\",\"name\":\"sheilathewriter\",\"description\":\"Custom essay writing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/sheilathewriter.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/opskill.com\/propapers\"],\"url\":\"https:\/\/sheilathewriter.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino - sheilathewriter","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/","og_locale":"en_US","og_type":"article","og_title":"lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino - sheilathewriter","og_description":"LAB REPORT #2Name Date Course Code Table of contents AbstractPage 3 Introduction Sin Wave Generator Page 4 Square Wave GeneratorPage","og_url":"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/","og_site_name":"sheilathewriter","article_published_time":"2024-04-26T22:56:00+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/","url":"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/","name":"lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino - sheilathewriter","isPartOf":{"@id":"https:\/\/sheilathewriter.com\/blog\/#website"},"datePublished":"2024-04-26T22:56:00+00:00","author":{"@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab"},"breadcrumb":{"@id":"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sheilathewriter.com\/blog\/lab-report-number-the-purpose-was-to-project-all-the-waves-on-oscilloscope-provide-by-the-code-teacher-net-duino\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sheilathewriter.com\/blog\/"},{"@type":"ListItem","position":2,"name":"lab report number (The purpose was to project all the waves on oscilloscope provide by the code teacher) Net Duino"}]},{"@type":"WebSite","@id":"https:\/\/sheilathewriter.com\/blog\/#website","url":"https:\/\/sheilathewriter.com\/blog\/","name":"sheilathewriter","description":"Custom essay writing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sheilathewriter.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/f5844d28db4a1882523a0a69560bf0ab","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sheilathewriter.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cf817440d627e98709fcac9c5cc379958985e679d683af80df1879b5a471013?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/opskill.com\/propapers"],"url":"https:\/\/sheilathewriter.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts\/34470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/comments?post=34470"}],"version-history":[{"count":0,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/posts\/34470\/revisions"}],"wp:attachment":[{"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/media?parent=34470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/categories?post=34470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sheilathewriter.com\/blog\/wp-json\/wp\/v2\/tags?post=34470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}