Understanding the Number Crumb
How the Number Crumb Works
The Number Crumb is designed to provide a simple display output for your Crumble. At this time, there is no native display for the Crumble and you have to give indications via the 4 outputs on the Crumble – perhaps lighting LEDs or sounding a buzzer.
The Number Crumb, however, is very different. There is a microprocessor on the Crumb which interprets the speed (PWM) information that you send to the motor on the Crumble.
Purchase Number Crumb here
Connecting the Number Crumb
- Connect power to the Number Crumb. The photo above shows Red for +ve and Black for -ve
- Then connect the motor outputs (either Motor 1 or Motor 2, it doesn’t matter which). Ensure that you connect the positive terminals together and the negative terminals together
- It doesn’t harm anything if you swap them over, but the Number Crumb with show negative numbers instead of positive, and vice versa
Programming the Number Crumb
To set a value on the Number Crumb, simply set the number you want into the “Motor Forward at nn %” block. Change nn to the number you want.
For example, the program above uses the variable x and starts at -30, then counts up to +100
The program below takes the input from an analog input (such as the Slider Crumb, Dial Crumb, or Light Sensor Crumb) and displays a value on the Number Crumb
Number Crumb Firmware
The Number Crumb has an ATMega328P on the PCB (under the display) which is configured as an Arduino Uno complete with bootloader. So you can reprogram the firmware to do whatever you want to do.
It has 2 digital I/O pins (D2 and D13) and then 10 pins are connected to the display via resistors.
There are 3 versions of the Number Crumb firmware in the field:
- Was released only for prototype Number Crumbs. This goes straight into number display mode when powered up
- Later prototypes and the first few production Number Crumbs had version 2. This displays “02″ for a couple of seconds when powered up
- Currently shipping is version 3. This displays ” 3″ for a couple of seconds when powered up.
The changes between the versions are mostly to do with stability of number display
- The input signals from the Crumble, together with the resolution of the onboard counter leads to variations in the number displayed which was not always the same as the number input into the Crumble’s motor
- Version 2 made big changes to this accuracy, but still had some numbers that were difficult to display reliably. In addition, it was quite slow reacting to new numbers which meant that it was not able to keep up with the counting program above. There was also a lot of flicker for numbers -100, 0 and +100
- The algorithm for counting has been improved so the resolution is better and the averaging and display algorithms have been more tightly integrated so that the flashing/flickering disappears. Leading zeros have been suppressed, which allows a minus sign to be used for numbers -1 to -9 instead of the dots.
The software essentially times the edges of the motor drive signal. PWM (Pulse Width Modulation) sends a pulse at a fixed frequency and varies the width of the pulse to increase or decrease the speed of the motor. The Number Crumb accurately times the edges and can work out from that what number was set in the motor control block of the software. Version 1 or the firmware would work with most PWM drivers, but version 2 and 3 are increasingly tuned to work very closely with the Crumble PWM and would probably give inconsistent or nonsensical values with other PWM drivers.
Programming the Number Crumb
There are six header holes on the Number Crumb that allow you to directly plug in a suitable CP2102 and reprogram the Crumb using the Arduino IDE. Set your board type to Uno and ensure you select the CP2102 as your port/device.
If you have firmware version before 3 and want to upgrade it, you can either do it yourself (contact us for the program) or send it back to us and we will reprogram it for you.