|
1 | | -# Move38 Blinks for the Arduino IDE |
2 | | -An Arduino core for the Blinks gaming tile. More info at... |
3 | | -http://move38.com |
| 1 | +# Blinks Software Development Kit (SDK) for Arduino |
4 | 2 |
|
5 | | -## Roadmap |
| 3 | +This SDK includes all the software and configuration files to tell the Arduino IDE how to download programs in a blink along with some examples you can try out and modify. |
6 | 4 |
|
7 | | -This core requires at least Arduino IDE v1.6.2, where v1.6.5+ is recommended. <br/> |
8 | | -* [Programmers](#programmers) |
9 | | -* **[How to install](#how-to-install)** |
10 | | -* **[Getting started](#getting-started)** |
| 5 | +These instructions will get you set up to write your own games for the [Blinks platform](https://move38.com/pages/blinks-collection) using the Arduino IDE. |
11 | 6 |
|
12 | | -Covers installing this repo so that you can write and download code into a Blinks tile using the Arduino IDE. |
| 7 | +Note that you do not need any of this if you just want to *play* blinks games, only if you want to write them. |
13 | 8 |
|
14 | | -Ends with loading a `HelloBlink` program it a tile. |
15 | 9 |
|
16 | | -### Writing games |
| 10 | +## Getting Started |
17 | 11 |
|
18 | | -The best way to start writing games is to work your way though the examples in the "File->Examples->Examples for Blink Tile" menu in the Arduino IDE (after you have installed this repo as described in the Getting Started above). |
19 | | - |
| 12 | +### Software setup |
20 | 13 |
|
21 | | -### [Service Port](Service Port.MD) |
| 14 | +1. Download and run the latest version of the[ Arduino IDE](https://www.arduino.cc/en/Main/Software#download) |
| 15 | +2. Go into File->Preferences->Settings and add... |
| 16 | +`https://github.com/bigjosh/Move38-Arduino-Platform/releases/latest/download/package_move38.com-blinks_index.json` |
| 17 | +...under Additional Boards Manager URLs. If you already have something there, you can use a comma to separate the multiple entries |
| 18 | +3. Go to Tools->Board->Boards Manager and search for "blinks" |
| 19 | +4. Press install on "Blinks by Move38" |
| 20 | +5. Pick "Tools->Board->Move38->blink" from the menus |
| 21 | +5. Go to "File->Example->Getting Started->Button Press" to load an example program |
| 22 | +6. Program the `Button Press` example code into a blink (see below) |
22 | 23 |
|
23 | | -Describes the service port connector on each blink. Lets you add `print` statements to your programs, which can be very helpful during development. |
24 | 24 |
|
25 | | -## How to install |
| 25 | +### Getting your code programmed into a blink |
26 | 26 |
|
27 | | -Click on the "Download ZIP" button in the upper right corner of this repo. Extract the ZIP file, and move the extracted files to the location "**~/Documents/Arduino/hardware/Move38-manual/avr**". Create the folder if it doesn't exist. This readme file should be located at "**~/Documents/Arduino/hardware/Move38-manual/avr/README.md**" when you are done. |
| 27 | +Each blink can hold a game in its on-board flash memory. Once a blink has a game programmed into it, it can also share to other blinks over the IR links. |
28 | 28 |
|
29 | | -Open Arduino IDE, and a new category in the boards menu called "Move38-manual" will show up. |
| 29 | +You will need a programmer, a cable, and a connector to get your code from the Arduino IDE into a blink's flash. |
| 30 | + |
| 31 | +The [Blinks Developer Kit](https://move38.com/products/bare-bones-dev-kit) that includes everything you need to start programming your own games, including a a special blink that connects to an included USB programmer to make downloading your code as easy as pushing the "upload" button in the Ardunio IDE. If you have the dev kit, follow the enclosed instructions to select the correct programmer in the IDE and everything should just work. |
| 32 | + |
| 33 | +But you do not need the dev kit to write your own games. Blinks can be programmed with any Arduino-compatible "AVR ISP" programmer and there are hundreds of these available everywhere. You can even use an[ Arduino UNO board plus a few wires](https://www.arduino.cc/en/Tutorial/ArduinoISP#toc2) to program any blink though the 6-pin In System Programming (ISP) connector inside the battery compartment (the arrow marks pin #1). |
30 | 34 |
|
31 | | -In the future, we'll offer a simplified Arduino Boards Manager install path. |
| 35 | +## What is Arduino? |
32 | 36 |
|
33 | | -### Notes |
| 37 | +The Arduino IDE is an an integrated development environment that makes it easy to write and download code to compatible microcontroller boards - and every blink is an Arduino compatible board. |
34 | 38 |
|
35 | | -* We called the "vendor/maintainer" folder `Move38-manual` so that you can also use the boards manager and you will be able to tell the two apart in the boards menu. |
| 39 | +We write a program in the IDE using Arduino programming language (basically the C/C++) and then we use a programmer to download the compiled program into a blink. |
36 | 40 |
|
37 | | -* You must manually create the `avr` folder and you must also manually move the files out from this repo into this folder. We could not automatically have the folds inside the repo match the Arduino required folder layout because in in the boards manager, the architecture is in the JSON file rather than the folder structure. Arg. |
| 41 | +## The `blinklib` library |
38 | 42 |
|
39 | | -* The "**~/Documents/Arduino/hardware/Move38-manual/avr**" folder is a Git repo and is also set up for easy editing in Atmel Studio with a solution inside the `\AS7` sub-folder. |
| 43 | +When you pick "blink" from the boards menu, you configure the Arduino IDE to automatically include a set of binks-specific functions whenever it compiles your code. You use these functions to set the colors on the blink's LEDs and check for button presses and send messages over the IR links and everything else a blink can do. You can see all the available `blinklib` functions [here](cores/blinklib/blinklib.h). |
40 | 44 |
|
41 | | -### API Layers |
| 45 | +## Serial support |
42 | 46 |
|
43 | | -The blinks hardware can do incredible things, and you can have unfettered access to it at any level you want. This documents describes those layers from bare metal up. |
| 47 | +Each blink also has a built in serial port so you can add `printf` statements to your code and view the resulting output on a computer running a serial terminal program. Again, each blink dev kit includes a cable and a USB serial board to make this plug and play, but you can also connect the wires yourself to any serial port than can accept 3.3 - 5 volt signals. More info on serial [here](Service Port.MD). |
44 | 48 |
|
| 49 | +## Making changes to the open source `blinklib` library |
45 | 50 |
|
| 51 | +You can make a fork of this repo and then clone it you the machine that you have the Arduino IDE installed on. Then add a symbolic link called `avr` to the top directory of the cloned repo (the directory with this readme in it) to the `Arduino/hardware/move38` directory. So, for example, on my windows machine I made the symbolic link with the commands... |
46 | 52 |
|
47 | | -#### Hardware Abstraction Layer |
| 53 | +``` |
| 54 | +d: |
| 55 | +cd D:\Documents\Arduino\hardware |
| 56 | +mkdir move38 |
| 57 | +cd move38 |
| 58 | +mklink /D avr D:\Github\Move38-Arduino-Platform |
| 59 | +``` |
48 | 60 |
|
49 | | -Most programmers will want to use the high level `blinks` API, but if you want to get closer to the hardware you can directly call into the `HAL` (Hardware Abstraction Layer) that the `blinks` API is built on top of. Documentation for this layer is in the [README.md](cores/blinkcore/README.md) in the `cores/blinkscore` folder. |
| 61 | +Quit out of the IDE and reload and you should see a new choice under the `boards` menu. |
| 62 | + |
| 63 | +We are always grateful for pull requests with bug fixes. For new features, best to discuss first [in the forums](https://forum.move38.com/c/softwareresources/9) to see what other think and if anyone is already working on something similar. |
| 64 | + |
| 65 | +### |
0 commit comments