Kilobot Library
debug.h File Reference

Go to the source code of this file.


#define debug_init()
 debug initialization More...

Macro Definition Documentation

#define debug_init ( )

debug initialization

This function initializes the hardware serial communication of the Kilobot. This function must be called before the kilo_start() function, but after the kilo_init() function.

Moreover, for the serial to be enabled the variable DEBUG (notice capitalization) must be defined before debug.h is included. Thereafter, the printf() function can be used to transmit debugging information to the kilobot controller through the attached serial cable.

#include <kilolib.h>
#define DEBUG
#include <debug.h>
void setup() { }
// print voltage every second
void loop() {
printf("%d\n", get_voltage());
int main() {
kilo_start(setup, loop);
return 0;