All examples presented in this book rely on the programming language Basic and its application in the mikroBasic compiler for dsPIC. It is thus necessary to introduce some of the concepts, modes of their applications, and their meanings in order to facilitate understaning of the abundant examples contained by the book. The simplest structures of Basic are used, so the examples can be understood with no need for an analysis of the programming language.
|TYPE||SIZE||RANGE OF VALUES|
|byte, char||8–bit||0 .. 255|
|short||8–bit||-127 .. 128|
|word||16–bit||0 .. 65535|
|integer||16–bit||-32768 .. 32767|
|longword, dword||32–bit||0 .. 4294967295|
|longint||32–bit||-2147483648 .. 2147483647|
dim i, j, k as byte dim counter, temp as word
dim real_number as float
dim weekdays as byte dim samples as wordAs can be noticed from the above examples, the indexes in an array can start from any integer value. If within the square brackets only one value is declared, the array has so many members (5 in the above example). In that case the index of the first member iz zero!
dim text as string
dim p as ^word