Thursday, June 15, 2017

This example of ESP8266/NodeMCU read input from A0, and output to Serial. The receiving side is a Raspberry Pi 3 running Raspbian Jessie with PIXEL and Arduino IDE installed, the result is display graphically using Arduino IDE's Serial Plotter. All job done on Raspberry Pi 3. ESP8266/NodeMCU connect to the Raspberry Pi 3 with USB.

This video show how to download, install and run Arduino IDE Linux ARM version (1 JUNE 2017 release), on Raspberry Pi 3 with Raspbian Jessie with PIXEL (2017-04-10 release). The Raspberry Pi connect to a 4" 800x480 HDMI IPS LCD Display, so it display in low resolution.

Reference:analogWrite(pin, value) enables software PWM on the given pin. PWM may be used on pins 0 to 16. Call analogWrite(pin, 0) to disable PWM on the pin. value may be in range from 0 to PWMRANGE, which is equal to 1023 by default. PWM range may be changed by calling analogWriteRange(new_range).

PWM frequency is 1kHz by default. Call analogWriteFreq(new_frequency) to change the frequency.