Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit c1d37f5

Browse files
author
Youssif
committed
README.md: adding section for Best Practices for Writing smartBASIC Apps
This section includes a couple of instructions and recommendations to users when writing smartBASIC applications.
1 parent 88dd367 commit c1d37f5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ Older firmwares
1919
-------------------------------
2020
The files in this repository are designed for use with the latest BL652 firmware, which at the time of writing is 28.7.3.0. For applications targeting older firmware, please check the [Releases tab](https://github.com/LairdCP/BL652-Applications/releases)
2121

22+
Best Practices for Writing smartBASIC Applications
23+
-------------------------------
24+
1. Always check the resultcode returned from an API function. Non-zero result codes usually indicate that the operation has not been successful.
25+
2. smartBASIC is event driven; ensure that the application is written in an event-driven manner. Starting with a state-machine or a flowchart is highly recommended.
26+
3. Minimize the use of WAITEVENTs; ideally, WAITEVENT should be used only once at the end of the program to ensure the app is simple and robust.
27+
4. Minimize radio usage when possible to save power.
28+
5. Use comments wherever possible to ensure that the appliaction can be read and understood.
29+
6. Only hard-code when necessary. When hard-coding, use #defines to give meaning to the constants used.
30+
7. Follow the smartBASIC app template found [here](https://github.com/LairdCP/BL652-Applications/blob/master/Applications/ttt.template.sb).
31+
2232
Notes
2333
-------------------------------
2434
Please note that for simplicity reasons, some sample apps have been written without important features such as error handling or result code checking. However, when writing your applications, please ensure that result codes returned from the API functions are always checked to ensure that your applications are robust and bug-free.

0 commit comments

Comments
 (0)