Input/Output pins
Last updated
Last updated
Waspmote can communicate with other external devices using different input/output ports.
It gets the value read by the corresponding analog input. Waspmote has 7 analog inputs in the sensor connector. Each input is directly connected to the microcontroller. The microcontroller uses a 10-bit analog to digital converter (ADC). The reference voltage value for the inputs is 0 V (GND). The maximum value of input voltage is 3.3 V. To obtain input values, the function analogRead()
is used. The value read from this function will be an integer number between 0 and 1023 bits, where 0 corresponds to 0 V and 1023 to 3.3 V.
Example of use:
The pinMode()
function configures the specified pin as an input or an output.
It returns nothing.
Example of use:
The digitalRead() function reads the value from the specified digital pin.
It returns '0' or '1'.
Example of use:
The digitalWrite() function writes a HIGH or LOW value to a digital pin. The pin voltage will be set to 3.3 V for a 'HIGH' value, and 0 V for a 'LOW' value.
Example of use:
There is one pin that can be used as an analog or digital pin.
This pin is called DIGITAL1.
It returns nothing.
Example of use: