INPUT DEVICES – SENSORS AND OUTPUT DEVICES – INDICATORS


INPUT DEVICES – SENSORS


Every electronic circuit must have some kind of input device so that we (the outside world) can "communicate" with it.





THE SWITCH

When the switch is closed it allows current to flow through it.

TYPES OF SWITCH


There are various types of switches that can do slightly different jobs in a circuit

SPST - sinqle pole, single throw

SPDT - single pole, double throw

DPST - double pole, double throw

DPDT - double pole, double throw


The diagrams show you examples of each type.

STUDENT INVESTIGATION
Which switch would you use to:
(a) change the direction of an electric motor
(b) switch on a light
(c) switch off a green light and switch on a red light
(d) switch on two motors at once


THE LIGHT DEPENDENT RESISTOR

This is a resistor which has a resistance that changes with the amount of LIGHT that falls on It. In the DARK its resistance is LARGE (millions of ohms), in the LIGHT its resistance is SMALL (tens of ohms). Very little current will flow through It In the dark.

THE THERMISTOR

This is a type resistor which has a resistance that changes with TEMPERATURE. In the COLD its resistance is LARGE (thousands of ohms), in the HEAT its resistance is SMALL (tens of ohms). Very little current will flow through it when it is cold.

Virtual functions in C++


 C++ virtual function is a member function of a class, whose functionality can be over-ridden in its derived classes. The whole function body can be replaced with a new set of implementation in the derived class. The concept of c++ virtual functions is different from C++ Function overloading.

C++ Virtual Function - Properties:

   C++ virtual function is,
  • A member function of a class
  • Declared with virtual keyword
  • Usually has a different functionality in the derived class
  • A function call is resolved at run-time
   The difference between a non-virtual c++ member function and a virtual member function is, the non-virtual member functions are resolved at compile time. This mechanism is called static binding. Where as the c++ virtual member functions are resolved during run-time. This mechanism is known as dynamic binding.

C++ Virtual Function - Reasons:

   The most prominent reason why a C++ virtual function will be used is to have a different functionality in the derived class.
   For example a Create function in a class Window may have to create a window with white background. But a class calledCommandButton derived or inherited from Window, may have to use a gray background and write a caption on the center. The Create function for CommandButton now should have a functionality different from the one at the class called Window.

C++ Virtual function - Example:

   This article assumes a base class named Window with a virtual member function named Create. The derived class name will be CommandButton, with our over ridden function Create.
     class Window // Base class for C++ virtual function example
     {
       public:
          virtual void Create() // virtual function for C++ virtual function example
          {
               cout <<"Base class Window"<

     class CommandButton : public Window
     {
       public:
          void Create()
          {
              cout<<"Derived class Command Button - Overridden C++ virtual function"<create();="" x="new" y->create();="" y="new" {="" };="" }<="" }="">

Vivid Technologies Interview Questions


1. What is the diff. between pointer variable and reference variable
2. What is static library and dynamic library
3. What is soft link
4. What is virtual function in C++
5. What is polymorphism in C++
6. What is the diff between Inline and Macro
7. What is the output of $WC | ls –l > file