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 (see- apps/README.mdfor more information).
Supported examples
Contents
- abntcodiABNT CODI example
- adcRead from ADC
- adjtimeAjdtime function example
- adxl372_testADXL372 test program
- ajoystickAnalog Joystick
- alarmRTC Alarm
- apa102Rainbow on- APA102LED Strip
- apds9960APDS-9960 test pplication
- audio_rttlAudio tone generator
- bastestBas BASIC Interpreter
- batteryBattery monitor example
- bme680BME680 sensor example
- bmi160BMI160 sensor example
- bmp180BMP180 Barometer sensor example
- bmp280BMP280 Barometer sensor example
- bridgeNetwork Bridge
- buttonsRead GPIO Buttons
- calib_udelayCalibration tool for udelay
- cameraCamera Snapshot
- canCAN Device Test
- capturePWM Capture example
- cbortestTinyCBOR Test Example
- cctypeVerify C++ cctype operations
- chatAT over TTY
- chronoChronometer example to use with STM32LDiscover
- configdataConfig Data example / unit test
- cordicCORDIC driver example
- cpuhogKeep CPU Busy
- cromfsCROMFS Example
- dacWrite to DAC
- dhcpdDHCP Server
- discoverUDP Discover Daemon
- djoystickDiscrete Joystick
- dronecanDroneCAN example
- elfELF loader
- embedlogembedlog example
- esp32_himemESP32 HIMEM Example
- etlEmbedded Template Library (ETL) C++ example
- fbFramebuffer
- fboverlayFramebuffer overlay test tool
- flash_testSMART Flash test
- flowcSerial Hardware Flow Control
- fmsynthFM Synthesizer examples
- focFOC motor controller example
- ft80xFT80x GUI Chip
- ftpcFTP Client
- ftpdFTP daemon
- fxos8700cq_test
- gpioGPIO Read and Write
- gpsGPS example
- hallHall effect sensor example
- hdc1008_demoHDC1008 driver example
- helloHello World
- hello_nimHello World in Nim
- hello_rustHello World in Rust
- hello_wasmHello World in WASM
- hello_zigHello World in Zig
- helloxxHello World in C++
- hidkbdUSB Host HID keyboard
- hts221_reader- HTS221Humidity Sensor
- i2ccharTransfer Through I2C
- i2sloopI2S loopback test
- igmpTrivial IGMP
- ina219Current/Power Monitor INA219
- ina226Current/Power Monitor INA219
- ini_dumperini dumper example
- ipcfgIP Configuration file example
- ipforwardIP Forwarding Using TUN
- jsoncJSON
- keyboard
- ledsToggle LEDs
- libtestStatic Library Test
- lis3dsh_reader- LIS3DSHAccelerometer
- lp503xLP503X PWM LED example
- lsm303_reader- LSM303Accelerometer/Magnetometer
- lsm6dsl_reader- LSM6DSLAccelerometer/Gyroscope
- ltr308LTR308 ambient light sensor example
- lua_moduleHello World Lua module
- lvgldemoLVGL Demo
- lvgltermLVGL Terminal for NuttShell (NSH)
- max31855max31855 example
- mcubootMCUboot examples
- mediaMedia test
- mldMLD example
- mlx90614MLX90614 Test Example
- mml_parserMML parser example
- modbusFreeModbus demo example
- modbusmasterModbus Master example
- moduleLoadable Module
- mountMount Filesystem
- mqttcMQTT-C Example
- mtdpartMTD Partition Test
- mtdrwbMTD Read-ahead and Write Buffering
- netlink_routeNetlink NETLINK_ROUTE test
- netloopNetwork loopback device
- netpkt- AF_PACKETRaw Sockets
- nettestClient/Server Over TCP
- nimbleNimBLE example
- nng_testNNG pubsub program
- noteprintf“Note printf!” example
- nrf24l01_btleEmulates a nRF8001 temperature beacon with nRF24L01
- nrf24l01_termNRF24L01 Wireless Connection
- nullNULL example
- nunchuck
- nxNX graphics example
- nxdemoNX Demo “Graphic test” example
- nxflatNXFLAT Binary
- nxhelloNX graphics “Hello, World!” example
- nximageDisplay NuttX Logo
- nxlinesNX Line Drawing
- nxscopeNxScope library example
- nxtermDisplay NuttShell (NSH) as NX Console
- nxtextDisplay NX Text
- obd2OBD-II application example
- oneshotOneshot Timer
- opencyphalOpenCyphal Cyphal/CAN example
- pca9635- PCA9635PWLED
- pdcursespdcurses demos
- pf_ieee802154PF_IEEE802154 example
- pipePipe example
- pollPoll example
- popenpopen() example
- posix_spawnposix_spawn Unit Test
- powerledPowerled driver example
- powermonitorLTC4151 powermonitor example
- pppdpppd client example
- pty_testPseudo-Terminals
- pwfbNX Per-Window Framebuffer Text Example
- pwlinesNX Per-Window Framebuffer Graphics Example
- pwmGeneral PWM Example
- qencoderQuadrature Encoder
- randomRandom Numbers
- relaysRelays
- rfid_readuidRFID example
- rgbledRGB LED Using PWM
- romfsFile System
- rpmsgsocketRpmsg socket example
- sendmailSMTP Client
- serialblasterSerial Blaster example
- serialrxSerial RX example
- serloopSerial Loopback
- shm_testSHM example
- sht3xSHT3x sensor example
- slcdAlphanumeric Segment LCD
- smpsSwitched-Mode Power Supply
- sotestShared Library Module Test
- statTest of stat(), fstat(), and statfs()
- sx127x_demoSX127X Radio
- systemSystem() example
- tcp_ipc_clientClient for TCP IPC NuttX
- tcp_ipc_serverServer for TCP IPC NuttX
- tcpblasterTCP Performance Test
- tcpechoTCP Echo Server
- telnetdSimple Telnet Shell
- termiosSimple Termios interface test
- thttpdTHTTPD server
- tiffTIFF file generation example
- timerTimer example
- timer_gpioTimer GPIO example
- touchscreenTouchscreen Events
- udgramUnix domain datagram example
- udpClient/Server Over UDP
- udpblasterUDP blaster example
- uidUID/GID example
- unionfsUnion File System
- usbserialUSB Serial Hello World
- userfsUserFS File System
- usrsocktestUSRSOCK test example
- ustreamUnix Stream Sockets
- veml6070VEML6070 UltraViolet sensor example
- watchdogWatchdog Timer
- watcherWatcher & Watched
- webserverSimple Webserver
- wgetWeb Client
- wgetjsonGET JSON Using- wget
- wiegandWiegand example
- ws2812ws2812 Demo
- ws2812esp32rmtws2812 Demo using ESP32_RMT
- xbc_testXBox Controller Example
- xmlrpcXML-RPC Server
- zerocrossZero Crossing Device