Examples
Selecting Examples
The examples directory contains several sample applications that can be linked
with NuttX. The specific example is selected in the
boards/<arch-name>/<chip-name>/<board-name>/configs/<config>/defconfig
file
via the CONFIG_EXAMPLES_xyz
setting where xyz
is the name of the example.
For example:
CONFIG_EXAMPLES_HELLO=y
Selects the examples/hello
“Hello, World!” example.
Built-In Functions
Some of the examples may be built as built-in functions that can be executed at run time (rather than as NuttX main programs). These built-in examples can be also be executed from the NuttShell (NSH) command line. In order to configure these built-in NSH functions, you have to set up the following:
CONFIG_NSH_BUILTIN_APPS
– Enable support for external registered, named applications that can be executed from the NSH command line (seeapps/README.md
for more information).
Supported examples
abntcodi
ABNT CODI exampleadc
Read from ADCadjtime
Ajdtime function exampleadxl372_test
ADXL372 test programajoystick
Analog Joystickalarm
RTC Alarmapa102
Rainbow onAPA102
LED Stripapds9960
APDS-9960 test pplicationaudio_rttl
Audio tone generatorbastest
Bas BASIC Interpreterbattery
Battery monitor examplebme680
BME680 sensor examplebmi160
BMI160 sensor examplebmp180
BMP180 Barometer sensor examplebmp280
BMP280 Barometer sensor examplebridge
Network Bridgebuttons
Read GPIO Buttonscalib_udelay
Calibration tool for udelaycamera
Camera Snapshotcan
CAN Device Testcapture
PWM Capture examplecbortest
TinyCBOR Test Examplecctype
Verify C++ cctype operationschat
AT over TTYchrono
Chronometer example to use with STM32LDiscoverconfigdata
Config Data example / unit testcordic
CORDIC driver examplecpuhog
Keep CPU Busycromfs
CROMFS Exampledac
Write to DACdhcpd
DHCP Serverdiscover
UDP Discover Daemondjoystick
Discrete Joystickdronecan
DroneCAN exampleelf
ELF loaderembedlog
embedlog exampleesp32_himem
ESP32 HIMEM Exampleetl
Embedded Template Library (ETL) C++ examplefb
Framebufferfboverlay
Framebuffer overlay test toolflash_test
SMART Flash testflowc
Serial Hardware Flow Controlfmsynth
FM Synthesizer examplesfoc
FOC motor controller exampleft80x
FT80x GUI Chipftpc
FTP Clientftpd
FTP daemonfxos8700cq_test
gpio
GPIO Read and Writegps
GPS examplehall
Hall effect sensor examplehdc1008_demo
HDC1008 driver examplehello
Hello Worldhello_nim
Hello World in Nimhello_rust
Hello World in Rusthello_wasm
Hello World in WASMhello_zig
Hello World in Zighelloxx
Hello World in C++hidkbd
USB Host HID keyboardhts221_reader
HTS221
Humidity Sensori2cchar
Transfer Through I2Ci2sloop
I2S loopback testigmp
Trivial IGMPina219
Current/Power Monitor INA219ina226
Current/Power Monitor INA219ini_dumper
ini dumper exampleipcfg
IP Configuration file exampleipforward
IP Forwarding Using TUNjson
cJSONkeyboard
leds
Toggle LEDsleds_rust
Toggle LEDs in Rustleds_zig
Toggle LEDs in Ziglibtest
Static Library Testlis3dsh_reader
LIS3DSH
Accelerometerlp503x
LP503X PWM LED examplelsm303_reader
LSM303
Accelerometer/Magnetometerlsm6dsl_reader
LSM6DSL
Accelerometer/Gyroscopeltr308
LTR308 ambient light sensor examplelua_module
Hello World Lua modulelvgldemo
LVGL Demolvglterm
LVGL Terminal for NuttShell (NSH)max31855
max31855 examplemcuboot
MCUboot examplesmedia
Media testmld
MLD examplemlx90614
MLX90614 Test Examplemml_parser
MML parser examplemodbus
FreeModbus demo examplemodbusmaster
Modbus Master examplemodule
Loadable Modulemount
Mount Filesystemmqttc
MQTT-C Examplemtdpart
MTD Partition Testmtdrwb
MTD Read-ahead and Write Bufferingnetlink_route
Netlink NETLINK_ROUTE testnetloop
Network loopback devicenetpkt
AF_PACKET
Raw Socketsnettest
Client/Server Over TCPnimble
NimBLE examplenng_test
NNG pubsub programnoteprintf
“Note printf!” examplenrf24l01_btle
Emulates a nRF8001 temperature beacon with nRF24L01nrf24l01_term
NRF24L01 Wireless Connectionnull
NULL examplenunchuck
nx
NX graphics examplenxdemo
NX Demo “Graphic test” examplenxflat
NXFLAT Binarynxhello
NX graphics “Hello, World!” examplenximage
Display NuttX Logonxlines
NX Line Drawingnxscope
NxScope library examplenxterm
Display NuttShell (NSH) as NX Consolenxtext
Display NX Textobd2
OBD-II application exampleoneshot
Oneshot Timeropencyphal
OpenCyphal Cyphal/CAN examplepca9635
PCA9635PW
LEDpdcurses
pdcurses demospf_ieee802154
PF_IEEE802154 examplepipe
Pipe examplepoll
Poll examplepopen
popen() exampleposix_spawn
posix_spawn Unit Testpowerled
Powerled driver examplepowermonitor
LTC4151 powermonitor examplepppd
pppd client examplepty_test
Pseudo-Terminalspwfb
NX Per-Window Framebuffer Text Examplepwlines
NX Per-Window Framebuffer Graphics Examplepwm
General PWM Exampleqencoder
Quadrature Encoderrandom
Random Numbersrelays
Relaysrfid_readuid
RFID examplergbled
RGB LED Using PWMromfs
File Systemrpmsgsocket
Rpmsg socket examplesendmail
SMTP Clientserialblaster
Serial Blaster exampleserialrx
Serial RX exampleserloop
Serial Loopbackshm_test
SHM examplesht3x
SHT3x sensor exampleslcd
Alphanumeric Segment LCDsmps
Switched-Mode Power Supplysotest
Shared Library Module Testspislv
SPI slave examplestat
Test of stat(), fstat(), and statfs()sx127x_demo
SX127X Radiosystem
System() exampletcp_ipc_client
Client for TCP IPC NuttXtcp_ipc_server
Server for TCP IPC NuttXtcpblaster
TCP Performance Testtcpecho
TCP Echo Servertelnetd
Simple Telnet Shelltermios
Simple Termios interface testthttpd
THTTPD servertiff
TIFF file generation exampletimer
Timer exampletimer_gpio
Timer GPIO exampletouchscreen
Touchscreen Eventsudgram
Unix domain datagram exampleudp
Client/Server Over UDPudpblaster
UDP blaster exampleuid
UID/GID exampleunionfs
Union File Systemusbserial
USB Serial Hello Worlduserfs
UserFS File Systemusrsocktest
USRSOCK test exampleustream
Unix Stream Socketsveml6070
VEML6070 UltraViolet sensor examplewatchdog
Watchdog Timerwatcher
Watcher & Watchedwebserver
Simple Webserverwget
Web Clientwgetjson
GET JSON Usingwget
wiegand
Wiegand examplews2812
ws2812 Demows2812esp32rmt
ws2812 Demo using ESP32_RMTxbc_test
XBox Controller Examplexmlrpc
XML-RPC Serverzerocross
Zero Crossing Device