CheeseBoard
A library for use with the CheeseBoard Cheddar platform
CheeseBoard Library

This library contains components for use with the CheeseBoard: Cheddar and variants, with examples which demonstrate the use of the various devices on the board:

Setting Up the Arduino IDE

Installing the Serial Drivers

Your computer must have the CP210x driver installed to communicate with the NodeMCU over USB.

Linux

Mac OSX

The driver for the NodeMCU's serial interface can be download from the Silican Labs website. Depending on the version of MacOS X you are running, will need different version of the driver.

Windows

On Windows, check to see if the driver is installed as follows:

  1. Connect the NodeMCU to your computer using a Micro-USB cable (connect the cable directly to the NodeMCU, not to the secondary (power only) MicroUSB socket on the CheeseBoard itself)
  2. Open Device Manager, and expand the group Ports (COM & LPT)
  3. If there is no entry for the CP210x driver, or it has an exclamation mark over the icon, you must install the driver
    • You can download the driver from the Silican Labs website
    • After installing the drive, unplug the USB cable and then plug it in again
  4. Once the driver is installed, the device's port identifier can be see in Device Manager under the Ports (COM & LPT) group - this idenfifier (e.g. COM3) is what is used in the ports setting in the Arduino IDE when uploading

Building and Uploading an Example Sketch

First set up the Arduino IDE as described above and install the CP210x driver if required. Then connect the NodeMCU to your computer using a Micro USB cable connected directly to the NodeMCU (not the power-only USB socket on the CheeseBoard PCB). Find the port setting for the NodeMCU, as described in "Installing the Serial Drivers" above.

If you have trouble with the upload, try adjusting the speed and trying again (with some cables the highest speeds don't work so well).

Each example has a README.md file which gives an overview of the functionality and how to use it.

Library Overview

The library defines the following objects and classes:

Notes About the CheeseBoard Library

The CheeseBoard library and examples use the Mutila library for various functions and classes. To avoid confusion, I'll mention a few here which you may notice in the examples:

0. The CheeseBoard library and examples are still under development at time of writing. Some of the code is a bit ugly and/or incomplete

  1. The macros DB, DBLN abd DBF act like Serial.print, Serial.println and Serial.printf respectively. These only produce output if DEBUG is defined, allowing quick enabling / disabling of debugging output on serial when building with the Makefile. To enable debugging output from the IDE, simply add this line at the top of your sketch:
#define DEBUG 1
  1. When sending color data to RGB LEDs, interrupts are disabled. This is because the timing of the signal is critical. However, this causes an unwanted side-effect - the counter which the millis() function returns is not updated while interrupts are disabled. With heavy RGB LED use, this causes the millis() return value to be less than excpected. With very frequent updates to RGB LEDs, this can be quite pronounced. Mutila implements Millis(), which does the same thing as millis(), but allows for a correction to be applied, which is done when the CbNeoPixel class is used (CbLeds is a global instance of CbNeoPixel).
  2. Mutila classes for hardware devices like buttons are all implemented with a timeslice approach. That is, they require an update() function to be called frequently to maintain their state. The idea behind this is to avoid using interrupts wherever possible in order to prevent conflicts with other libraries.
  3. In the examples, global instances of classes are defined in files whose names are the same as the global object, e.g. Button.h and Button.cpp should define a global object called Button. If the class of that object is also defined in these files, the class name may be the same as the object name with an underscore or "Class" as a suffix.
  4. In the CheeseBoard examples, I include function prototypes before any function definitions. This is so I can have setup() and loop() at the top of the main source file, but still build with a Makefile. They are not strictly necessary for the IDE build.
  5. EspApConfigurator is my own re-implementation of venerable WiFi Manager library. It doesn't block like WiFi Manager, and has a better (IMO) persistent settings system. At time of writing, EspApConfigurator is not complete - multi-page setup mode and custom themed settings pages are still to be implemented. However, single page configuration mode works just fine, which is what we use in the CheeseBoard examples.

More detailed Doxygen-generated API documentation for the library can be found here:

Selecting Cheeseboard Version

Select your hardware by editing the CheeseboardConfig.h file, specifying the ???????Config.h file for your hardware and version. For example, the prototype CheeseBoard: Cheddar uses the config file CheddarV0Config.h, so we edit the CheeseboardConfig.h to contain:

#pragma once
#include "CheddarV0Config.h"

At time of writing, this is the default since this is the only board which has been made. This mechanism may change in future releases.

Future