A library for easier setup and prototyping of IoT devices (pucks), by collecting everything that is common for all pucks in one place.

Dependencies:   BLE_API nRF51822

Dependents:   ir-puck display-puck ir-puck2 BLE_ScoringDevice ... more

/media/uploads/stiaje/header.jpg

Introduction

Raspberry Pi took the maker community by storm when it launched in 2012. With its internet access it allowed small projects to be internet-of-things enabled. We have created a platform to take this one step further.

Our platform, called the Puck platform, is an internet of things platform for mbed. mbed makes it easy to program embedded hardware for people new to embedded systems. Our platform is built upon the first mbed chip with Bluetooth, the nRF51822 created by Nordic Semiconductor. We hope to create a community around these BLE devices where people contribute to the project, and share their designs with each other. Everything is open-source, of course, with lots of supporting materials.

We make it easy to rapidly prototype and develop Bluetooth LE enabled devices - get up and running in under 10 lines of code.

Tutorials and in-depth documentation is available at the project's GitHub page

Pucks

We've developed a handful of awesome examples to demonstrate the platform. These examples are named 'Pucks'. By talking to the internet through your smartphone, the barrier to creating your own Internet of Things device is lower than ever.

Committer:
cristea
Date:
Thu Jul 24 09:25:42 2014 +0000
Revision:
7:c07c01c2a741
Child:
12:8a8cc109f048
Hoist logging out of Puck.h; ; There was a problem with multiple definitions of functions in Puck.h if; used in two different files. The logger has been moved out so that we; have independent loggers for each file, which can have different verbosity.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cristea 7:c07c01c2a741 1 #ifndef __LOG__H__
cristea 7:c07c01c2a741 2 #define __LOG__H__
cristea 7:c07c01c2a741 3
cristea 7:c07c01c2a741 4
cristea 7:c07c01c2a741 5 #ifdef LOG_LEVEL_VERBOSE
cristea 7:c07c01c2a741 6 #define __PUCK_LOG_LEVEL_VERBOSE__
cristea 7:c07c01c2a741 7 #endif
cristea 7:c07c01c2a741 8 #ifdef LOG_LEVEL_DEBUG
cristea 7:c07c01c2a741 9 #define __PUCK_LOG_LEVEL_DEBUG__
cristea 7:c07c01c2a741 10 #endif
cristea 7:c07c01c2a741 11 #ifdef LOG_LEVEL_INFO
cristea 7:c07c01c2a741 12 #define __PUCK_LOG_LEVEL_INFO__
cristea 7:c07c01c2a741 13 #endif
cristea 7:c07c01c2a741 14 #ifdef LOG_LEVEL_WARN
cristea 7:c07c01c2a741 15 #define __PUCK_LOG_LEVEL_WARN__
cristea 7:c07c01c2a741 16 #endif
cristea 7:c07c01c2a741 17 #ifdef LOG_LEVEL_ERROR
cristea 7:c07c01c2a741 18 #define __PUCK_LOG_LEVEL_ERROR__
cristea 7:c07c01c2a741 19 #endif
cristea 7:c07c01c2a741 20
cristea 7:c07c01c2a741 21 #ifdef __PUCK_LOG_LEVEL_VERBOSE__
cristea 7:c07c01c2a741 22 #define LOG_VERBOSE(fmt, ...) do { logger.printf("[V] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 23 #define __PUCK_LOG_LEVEL_DEBUG__
cristea 7:c07c01c2a741 24 #else
cristea 7:c07c01c2a741 25 #define LOG_VERBOSE(fmt, ...)
cristea 7:c07c01c2a741 26 #endif
cristea 7:c07c01c2a741 27
cristea 7:c07c01c2a741 28 #ifdef __PUCK_LOG_LEVEL_DEBUG__
cristea 7:c07c01c2a741 29 #define LOG_DEBUG(fmt, ...) do { logger.printf("[D] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 30 #define __PUCK_LOG_LEVEL_INFO__
cristea 7:c07c01c2a741 31 #else
cristea 7:c07c01c2a741 32 #define LOG_DEBUG(fmt, ...)
cristea 7:c07c01c2a741 33 #endif
cristea 7:c07c01c2a741 34
cristea 7:c07c01c2a741 35 #ifdef __PUCK_LOG_LEVEL_INFO__
cristea 7:c07c01c2a741 36 #define LOG_INFO(fmt, ...) do { logger.printf("[I] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 37 #define __PUCK_LOG_LEVEL_WARN__
cristea 7:c07c01c2a741 38 #else
cristea 7:c07c01c2a741 39 #define LOG_INFO(fmt, ...)
cristea 7:c07c01c2a741 40 #endif
cristea 7:c07c01c2a741 41
cristea 7:c07c01c2a741 42 #ifdef __PUCK_LOG_LEVEL_WARN__
cristea 7:c07c01c2a741 43 #define LOG_WARN(fmt, ...) do { logger.printf("![W] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 44 #define __PUCK_LOG_LEVEL_ERROR__
cristea 7:c07c01c2a741 45 #else
cristea 7:c07c01c2a741 46 #define LOG_WARN(fmt, ...)
cristea 7:c07c01c2a741 47 #endif
cristea 7:c07c01c2a741 48
cristea 7:c07c01c2a741 49 #ifdef __PUCK_LOG_LEVEL_ERROR__
cristea 7:c07c01c2a741 50 #define LOG_ERROR(fmt, ...) do { logger.printf("!![E] "); logger.printf(fmt, ##__VA_ARGS__); } while(0)
cristea 7:c07c01c2a741 51 #else
cristea 7:c07c01c2a741 52 #define LOG_ERROR(fmt, ...)
cristea 7:c07c01c2a741 53 #endif
cristea 7:c07c01c2a741 54
cristea 7:c07c01c2a741 55 #ifdef __PUCK_LOG_LEVEL_ERROR__
cristea 7:c07c01c2a741 56 static Serial logger(USBTX, USBRX);
cristea 7:c07c01c2a741 57 #endif
cristea 7:c07c01c2a741 58
cristea 7:c07c01c2a741 59
cristea 7:c07c01c2a741 60 #endif //__LOG__H__