-
Notifications
You must be signed in to change notification settings - Fork 3
Developing Custom Scripts and Firmware
Owen Schwartz edited this page Jul 8, 2020
·
8 revisions
- Download and install the Arduino IDE.
- Open preferences
- Next to "Additional Boards Manager URLs:" paste the following URL:
https://raw.githubusercontent.com/oschwartz10612/Scanner-Pro-MK3/master/arduino_board/package_scannerpro_index.json
- Click "Okay"
- Add the board in boards manager. Tools > Board > Boards Manager...
- Scroll to the bottom to "Scanner Pro MK3"
- Hover over the entry and click install.
It is recommended to start with the simple example. You can find this under File > Examples > Examples From Custom Libraries > ScannerPro > Simple_Start
This simple example sketch walks you through using basic functions of the board.
#include <Scanner.h>
Scanner Scanner;
String data;
void setup() {
//Put your code here to run once
}
void loop() {
//Put your code here to loop
if(Scanner.available()) { //Check if there is data to read from the scanner
data = Scanner.read_enter(); //Read the scanner data into a string. Use Scanner.read_tab() if your device uses tabs.
//Example munipulation
Scanner.print(data); //Print the scanner data
Scanner.write(10); //Send a new line
Scanner.print("END"); //Print the text "END"
}
}
The library is included with the board installation. It can be included in a new sketch with the following
#include <Scanner.h>
See the library documentation for more information.
Sketch > Export compiled Binary
The binary hex file will be placed into your sketch folder.
Once you have written your firmware, open a pull request to add it to the repository in the firmware directory so others can use your script.