Essay > Words: 1138 > Rating: Excellent > Buy full access at $1
LAB REPORT #2
Table of contents
Abstract Page 3
Sin Wave Generator Page 4
Square Wave Generator Page 5-6
Saw tooth Wave Generator Page 7
Conclusion Page 8
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.
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.
Sine Wave Generator
//Gives a PWM output that, its duty cycle varies as a function of a sine wave.
//It is like DAC. To see a Sine wave on scope pass the output through a low pass RC filter.
//Also if you connect the output to a LED its intensity varies like a sine wave.
int value = 0;
int degree = 0;
//PWM pwm = new PWM(Pins.GPIO_PIN_D5);
PWMpwm = newPWM(Cpu.PWMChannel.PWM_3, 500, 0.5, false);//PIN D10
degree += 1; // lets go from 0 to 360 degree over and over
degree %= 360; //remainder of 0-359
// sin() function returns an integer from -1000 to 1000. We need to shift it up by a 1000 to become positive
value = 1000 + Microsoft.SPOT.Math.Sin(degree); // value is between 0 and 2000
uintnValue = (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
In this starting wave generator which is Sine wave, the.............
Type: Essay || Words: 1138 Rating || ExcellentSubscribe at $1 to view the full document.
Buy access at $1