Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. What is an event handler? Give an Example. This code is intended for Netduino and it controls the brightness of a led that is

image text in transcribed
7. What is an event handler? Give an Example. This code is intended for Netduino and it controls the brightness of a led that is connected to pin D5. Comment each line as indicated. Your comments has to be meaningful and relevant rather than repeating what the code is, in literal sense. public class Program WIn this program the output of the photocell is used to set the duty cycle of the pwm that controls. / the brightness of the LED on pin DS. Touch photocell to control the amount of light. static AnalogInput lightSensor-new AnalogInput/Pins. GPIO PIN_A0) public static void Main() int value = 0; PWM pwm new PWM(Pins GPIO PIN_D5): while(true) value=lightSensor.Read) uint n Value = (uint value /& / pwm Set DutyCyclerValue Debug Printvalue. ToString() set the duty-cycle to a specific value 9. Explain what PWM stands for? and what it is used for? Use graph drawing to explain the idea of pwm. 10-This code is intended for Netduino. Explain what it clearly does. Modify the code that it sends A message Hello world! ONLY ONCE. public static void Main() var Serial Port new Serial Port(Serial Ports. COMI, 300, Parity None 8 StopBits One) Serial Port.Open(); System.Text.UTF8Encoding encoder-new System.Text.UTF&Encoding: byte[] bytes To Send encoder GetBytes("wwwwwwwwwr): while (true) Serial Port. Write(bytes To Send, 0, bytes To Send.Length); 11-The middle wiper pin of a 10K potentiometer is connected to Analog- in pin A0 of a Netduino with 4.2 Framework version. The outer pins of the pot are connected to 3.3V and ground respectively. If the potentiometer is turned half way what is the voltage on Aonalog-in pin AO. 12-Modify the following Netduino code such that when the on board button is pressed a frequency of 400HZ is generated and when release it is silent (frequency-zero)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Compute the derivative f(x)=(x-a)(x-b)

Answered: 1 week ago