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.mdfor more information).
Supported examples
Contents
abntcodiABNT CODI exampleadcRead from ADCadjtimeAjdtime function exampleadxl372_testADXL372 test programajoystickAnalog JoystickalarmRTC Alarmapa102Rainbow onAPA102LED Stripapds9960APDS-9960 test applicationaudio_rttlAudio tone generatorbaromonitorBarometer Dashboard ExamplebastestBas BASIC InterpreterbatteryBattery monitor examplebme680BME680 sensor examplebmi160BMI160 sensor examplebmp180BMP180 Barometer sensor examplebmp280BMP280 Barometer sensor example- BOARDIOC_SPINLOCK Spinlock Example
bridgeNetwork BridgebuttonsRead GPIO Buttonscalib_udelayCalibration tool for udelaycameraCamera SnapshotcanCAN Device TestcapturePWM Capture examplecbortestTinyCBOR Test ExamplecctypeVerify C++ cctype operationschatAT over TTYchronoChronometer example to use with STM32LDiscoverconfigdataConfig Data example / unit testcordicCORDIC driver examplecpuhogKeep CPU BusycromfsCROMFS ExampledacWrite to DACdhcpdDHCP ServerdiscoverUDP Discover DaemondjoystickDiscrete JoystickdronecanDroneCAN exampleelfELF loaderembedlogembedlog exampleesp32_himemESP32 HIMEM ExampleetlEmbedded Template Library (ETL) C++ examplefbFramebufferfboverlayFramebuffer overlay test toolflash_testSMART Flash testflowcSerial Hardware Flow ControlfmsynthFM Synthesizer examplesfocFOC motor controller exampleft80xFT80x GUI ChipftpcFTP ClientftpdFTP daemonfxos8700cq_testgpioGPIO Read and WritegpsGPS examplehallHall effect sensor examplehdc1008_demoHDC1008 driver examplehelloHello Worldhello_nimHello World in Nimhello_wasmHello World in WASMhello_zigHello World in ZighelloxxHello World in C++hidkbdUSB Host HID keyboardhts221_readerHTS221Humidity Sensori2ccharTransfer Through I2Ci2sloopI2S loopback testigmpTrivial IGMPina219Current/Power Monitor INA219ina226Current/Power Monitor INA226ini_dumperini dumper exampleipcfgIP Configuration file exampleipforwardIP Forwarding Using TUNjsoncJSONkeyboardledsToggle LEDsleds_rustToggle LEDs in Rustleds_zigToggle LEDs in Ziglely_masterLely CANopen master examplelely_slaveLely CANopen slave examplelibtestStatic Library Testlis3dsh_readerLIS3DSHAccelerometerlp503xLP503X PWM LED examplelsm303_readerLSM303Accelerometer/Magnetometerlsm6dsl_readerLSM6DSLAccelerometer/Gyroscopeltr308LTR308 ambient light sensor examplelua_moduleHello World Lua modulelvgldemoLVGL DemolvgltermLVGL Terminal for NuttShell (NSH)max31855max31855 examplemcubootMCUboot examplesmediaMedia testmldMLD examplemlx90614MLX90614 Test Examplemml_parserMML parser examplemodbusFreeModbus demo examplemodbusmasterModbus Master examplemoduleLoadable ModulemountMount FilesystemmqttcMQTT-C ExamplemtdpartMTD Partition TestmtdrwbMTD Read-ahead and Write Bufferingnetlink_routeNetlink NETLINK_ROUTE testnetloopNetwork loopback devicenetpktAF_PACKETRaw SocketsnettestClient/Server Over TCPnimbleNimBLE examplenng_testNNG pubsub programnoteprintf“Note printf!” examplenrf24l01_btleEmulates a nRF8001 temperature beacon with nRF24L01nrf24l01_termNRF24L01 Wireless ConnectionnullNULL examplenunchucknxNX graphics examplenxdemoNX Demo “Graphic test” examplenxflatNXFLAT BinarynxflatxipNXFLAT Executed In Place from XIPFSnxhelloNX graphics “Hello, World!” examplenximageDisplay NuttX LogonxlinesNX Line DrawingnxmbserverNxModbus Server ExamplenxscopeNxScope library examplenxtermDisplay NuttShell (NSH) as NX ConsolenxtextDisplay NX Textobd2OBD-II application exampleoneshotOneshot TimeropencyphalOpenCyphal Cyphal/CAN examplepca9635PCA9635PWLEDpdcursespdcurses demospf_ieee802154PF_IEEE802154 examplepipePipe examplepollPoll examplepopenpopen() exampleposix_spawnposix_spawn Unit TestpowerledPowerled driver examplepowermonitorLTC4151 powermonitor examplepppdpppd client examplepty_testPseudo-TerminalspulsecountPulse Count ExamplepwfbNX Per-Window Framebuffer Text ExamplepwlinesNX Per-Window Framebuffer Graphics ExamplepwmGeneral PWM ExampleqencoderQuadrature EncoderrandomRandom NumbersrelaysRelaysrfid_readuidRFID examplergbledRGB LED Using PWMrng90RNG90 TRNG ExampleromfsFile SystemrpmsgsocketRpmsg socket example- Rust Examples
sendmailSMTP ClientserialblasterSerial Blaster exampleserialrxSerial RX exampleserloopSerial Loopbackshm_testSHM examplesht3xSHT3x sensor exampleslcdAlphanumeric Segment LCDsmfState Machine Framework HSM PSiCC2 ExamplesmpsSwitched-Mode Power SupplysotestShared Library Module TestspislvSPI slave examplestatTest of stat(), fstat(), and statfs()sx127x_demoSX127X RadiosystemSystem() exampletcp_ipc_clientClient for TCP IPC NuttXtcp_ipc_serverServer for TCP IPC NuttXtcpblasterTCP Performance TesttcpechoTCP Echo ServertelnetdSimple Telnet ShelltermiosSimple Termios interface testthttpdTHTTPD servertiffTIFF file generation exampletimerTimer exampletimer_gpioTimer GPIO exampletouchscreenTouchscreen EventstxmorseMorse code transmitterudgramUnix domain datagram exampleudpClient/Server Over UDPudpblasterUDP blaster exampleuidUID/GID exampleunionfsUnion File SystemusbserialUSB Serial Hello WorlduserfsUserFS File SystemusrsocktestUSRSOCK test exampleustreamUnix Stream Socketsuvc_camUVC Camera streaming applicationveml6070VEML6070 UltraViolet sensor examplewatchdogWatchdog TimerwatcherWatcher & WatchedwebpanelNuttX Web PanelwebserverSimple WebserverwgetWeb ClientwgetjsonGET JSON UsingwgetwiegandWiegand examplews2812ws2812 Demows2812esp32rmtws2812 Demo using ESP32_RMTxbc_testXBox Controller Examplexedge_demoa lightweight Lua-based web framework for building secure, real-time IoT applications- Further Reading
xmlrpcXML-RPC ServerzerocrossZero Crossing Device