Waspmote Programming Guide
Development website
  • Initial page
  • Introduction
  • Program structure
  • Libraries includes
  • Variable declaration
  • Code style
  • General advice
  • RTC watchdog
  • Flash memory
  • EEPROM
  • RAM
  • Power
  • Sensor Boards
  • Networking
  • Frame class
  • Interfacing with Meshlium
  • Real deployment advice
  • API changelog
  • GitHub Project
Powered by GitBook
On this page

Was this helpful?

Variable declaration

It is recommended to declare global variables before the setup function of the code. For example:

// Global variables declaration
char str[] = "This is a string";
uint8_t number = 0;
int counter = 0;

void setup()
{ 
}  

void loop()
{
    counter++;
    USB.println(str);
    number = 121;
}

Variable types defined in <stdint.h>:

typedef signed char int8_t
typedef unsigned char uint8_t
typedef signed int int16_t
typedef unsigned int uint16_t
typedef signed long int int32_t
typedef unsigned long int uint32_t
typedef signed long long int int64_t
typedef unsigned long long int uint64_t
PreviousLibraries includesNextCode style

Last updated 4 years ago

Was this helpful?