Download Print this page

Advertisement

Quick Links

10/26/2016
Getting Started with LattePanda
Power on your LattePanda
Connect with your peripheral device
Connect to Wi-Fi
Connect with 7" Display and Touch Panel Overlay
Software & Operating Systems
How to setup a VNC server on the LattePanda using TightVNC
Hardware & Accessories
Inputs and Outputs
How to access pinouts from Visual Studio
Project Examples
Node-RED
Turn a LattePanda in to a 3D Print Server Using Octoprint
Face Detection using OpenCV
Troubleshooting & FAQs
How do I know LattePanda is on?
How do I re-install LattePanda Windows system?
What Boot Method Does LattePanda Use?
Common Adapters and USB cable recommendations
Power on your LattePanda
The LattePanda is powered through the micro USB port. Any standard USB adapter (such as a cell phone wall charger) with
at least 2A of current can be used as a power supply for the LattePanda. A power adapter will not be bundled with the
board, but you may get one from our online store or any electronics retailer.
Note: Check your power adapter and USB cable connection before use. Insufficient or unstable current may prevent your
LattePanda from initializing.
Here's our list of recommended power adapters and cables
When you have an adapter and micro USB cable ready, follow the instructions below to get started with your LattePanda.
1.Plug the USB into the USB power adapter, and the microUSB into the micro USB port of the LattePanda (The micro USB
port is located next to the SD card socket).
If you need IPS display and touch panel, please plug it first
http://www.lattepanda.com/docs/
Docs | LattePanda
CONTENTS
GETTING STARTED
Welcome 
1/58

Advertisement

loading
Need help?

Need help?

Do you have a question about the DFR0418 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for LattePanda DFR0418

  • Page 1 Docs | LattePanda Welcome  CONTENTS Getting Started with LattePanda Power on your LattePanda Connect with your peripheral device Connect to Wi-Fi Connect with 7“ Display and Touch Panel Overlay Software & Operating Systems How to setup a VNC server on the LattePanda using TightVNC Hardware & Accessories Inputs and Outputs How to access pinouts from Visual Studio Project Examples Node-RED Turn a LattePanda in to a 3D Print Server Using Octoprint Face Detection using OpenCV Troubleshooting & FAQs How do I know LattePanda is on? How do I re-install LattePanda Windows system? What Boot Method Does LattePanda Use? Common Adapters and USB cable recommendations GETTING STARTED Power on your LattePanda The LattePanda is powered through the micro USB port. Any standard USB adapter (such as a cell phone wall charger) with at least 2A of current can be used as a power supply for the LattePanda. A power adapter will not be bundled with the board, but you may get one from our online store or any electronics retailer. Note: Check your power adapter and USB cable connection before use. Insufficient or unstable current may prevent your LattePanda from initializing. Here’s our list of recommended power adapters and cables When you have an adapter and micro USB cable ready, follow the instructions below to get started with your LattePanda. 1.Plug the USB into the USB power adapter, and the microUSB into the micro USB port of the LattePanda (The micro USB port is located next to the SD card socket). If you need IPS display and touch panel, please plug it first http://www.lattepanda.com/docs/ 1/58...
  • Page 2 10/26/2016 Docs | LattePanda 2.When plugged in, you should see the red LED indicator lights up on the underside of the board. This means that the LattePanda is initializing. Wait patiently for a few seconds until the LED goes out. 3.When the LED turns off, press and hold the power button for one second to turn the LattePanda on. You should see the LED lights up again http://www.lattepanda.com/docs/ 2/58...
  • Page 3 10/26/2016 Docs | LattePanda Connect with your peripheral device LattePanda is compatible with a wide range of peripheral devices. You may connect any USB supported devices, such flash drives, mouse and keyboard, or a webcam to USB 3.0 and 2.0 ports. The SD card socket supports extra storage from a mini SD card. You may also connect the LattePanda to an external speaker device through its 3.5mm audio jack. The LattePanda’s Arduino compatible co-processor with plug and play headers and GPIO pins supports standard 5V sensors and actuators that enable it to interact with the physical world. http://www.lattepanda.com/docs/ 3/58...
  • Page 4 10/26/2016 Docs | LattePanda Connect to Wi-Fi 1.Install the Wi-Fi antenna by plugging the round shaped end into the socket labelled “ANT” located next to the GPIO pins on the board. 2.In Windows select a Wi-Fi connection by clicking the Wi-Fi icon in the system tray at the bottom right of the screen. Follow the wizard to setup a connection. Note: A weak Wi-Fi signal may prevent a Wi-Fi connection being established. Check the antenna is connected properly to the board and make sure that a Wi-Fi network is available. Connect with 7“ Display and Touch Panel Overlay http://www.lattepanda.com/docs/ 4/58...
  • Page 5 10/26/2016 Docs | LattePanda Note:Please connect it with LattePanda BEFORE power-on. And make sure the Golden Finger face the right side.  The contacts on FPC are so compact and in order. Please be careful that any dislocation connection may cause the LattePanda short circuit and the IPS display abnormal like ghosting or flicker. 1.Lift up the actuator. Use thumb or index finger might be easier. http://www.lattepanda.com/docs/ 5/58...
  • Page 6 10/26/2016 Docs | LattePanda 2.Insert display FPC in. Place Golden Finger side down! Note: The FPC must be fully inserted in the connector. If not fully inserted, the actuator will not close properly. Should this be the case, lift up the actuator and repeat the process (starting with Step 1 above) 3.Rotate down the actuator until firmly closed. 4.Insert the FPC of touch panel in Same as the display. Place the Golden Finger side down too. http://www.lattepanda.com/docs/ 6/58...
  • Page 7 10/26/2016 Docs | LattePanda Software & Operating Systems Setting up a VNC server on the LattePanda using TightVNC INTRODUCTION In this tutorial I will demonstrate how to install a VNC service on your LattePanda using Windows. This will enable you to access the GUI of Windows running on your LattePanda from a different PC on your local network. I will use TightVNC, a free and easy to set up service. VNC stands for “Virtual Network Computing”. It is a way of transmitting the keyboard and mouse events of one computer to another - in other words using one computer to remote control another. This is useful because you might not have extra monitors, keyboards or mice lying around – using a VNC service enables you to access several computers on your local network using just one computer, monitor, keyboard and mouse. You might also have a headless server set up which doesn’t require constantly attached peripherals. Setting up a VNC server on your headless server is a handy way to interface with a GUI if and when you need it. Let’s get started: STEP 1 - INSTALLATION 1. Download and install TightVNC for Windows on your LattePanda. Choose 32-bit or 64-bit depending on your system architecture. (LattePanda Standard is 32-bit, LattePanda Enhanced is 64-bit) http://www.lattepanda.com/docs/ 7/58...
  • Page 8 10/26/2016 Docs | LattePanda Download (http://www.tightvnc.com/download.php) 2. End-User Licence Agreement Accept the licence agreement and click next 3. Choose Setup Type Typical installation will install both TightVNC server and TightVNC viewer on your LattePanda Custom installation allows you to select which elements to install. Really all we need is the server, unless you would like http://www.lattepanda.com/docs/ 8/58...
  • Page 9 10/26/2016 Docs | LattePanda to be able to view other PCs on your network through the LattePanda, in which case you will need the viewer as well. For this tutorial we will just do the typical install. http://www.lattepanda.com/docs/ 9/58...
  • Page 10 10/26/2016 Docs | LattePanda 4. Select Additional Tasks Check all the boxes http://www.lattepanda.com/docs/ 10/58...
  • Page 11 10/26/2016 Docs | LattePanda 5. Ready to Install TightVNC Click Install to begin! http://www.lattepanda.com/docs/ 11/58...
  • Page 12 10/26/2016 Docs | LattePanda 6. TightVNC Server: Set Passwords Password-based A At this point it is wise to set a password for remote access. Point the radio button towards “Require password-based authentication” and choose a password. Retype it in the following box. I have set the password as “lattepan” (as the password can’t be longer than 8 characters) 7. Administrative Password This is not strictly necessary. In this tutorial I will not set an administrative password, but you may if you wish. If you set a password for this you will have to enter it before changing any configuration settings. When you are happy with your settings, click “OK”. Click “Finish” to exit the setup wizard. STEP 2 - CONFIGURATION http://www.lattepanda.com/docs/ 12/58...
  • Page 13 10/26/2016 Docs | LattePanda You should now see a new icon in your system tray. (If you don’t, try logging out and logging back in to your PC). Here you can see the IP address your PC is on. Double click it to bring up the service configuration window. The default settings should be fine for our purposes. Next, you will need to go on to the computer you would like to control the LattePanda with and using the same installation package, install TightVNC viewer. When you have successfully installed TightVNC viewer, check that you are on the same network as your LattePanda, otherwise it will not work! When you are certain that your computer and the LattePanda are on the same local network, proceed to step 3 STEP 3 - TESTING http://www.lattepanda.com/docs/ 13/58...
  • Page 14 10/26/2016 Docs | LattePanda Open TightVNC Viewer. A window will appear for a new TightVNC Connection. At this point, you need to input the IP address of your LattePanda. Tip: A quick way of finding this is if you hover over the system tray TightVNC icon on your LattePanda. A hint will pop up with “TightVNC Service - ” You could also go in to your router control interface and look for attached devices. The next step is to input this IP address in the New TightVNC Connection Window, followed by the port number you set in the service settings. The default is port 5900. <ip address of LattePanda>:<port number> e.g. 192.168.2.60:5900 Click connect. If all goes well you will be prompted with a password input. Input the password you set earlier. My password was “lattepan”. Press enter. You will be greeted by a window containing your LattePanda’s GUI! You may now control it remotely! http://www.lattepanda.com/docs/ 14/58...
  • Page 15: Inputs And Outputs

    10/26/2016 Docs | LattePanda This concludes the LattePanda VNC tutorial. If you have any questions or comments please let us know in the forum. I hope this has been of help to you. Hardware & Accessories Inputs and Outputs In this article we will discuss the images of the Lattepanda. Below is a basic diagram that displays all the pins: http://www.lattepanda.com/docs/ 15/58...
  • Page 16 10/26/2016 Docs | LattePanda Pinouts in area U1 are assigned to the X-Z8300 core. Pinouts in area U2 are assigned to the ATmega32u4 core. Each of the 20 digital pins (A0 - A5, D0 - D13) in area U2 can be used as an input or output, each operating at 5 volts. Each pin can output or receive 40 mA and each has an internal pull-up resistor (disconnected by default) of 20-50k ohm. Caution: Exceeding 40mA on any I/O pin may cause permanent damage to the ATmega32u4. Some pins have specialized functions: Analog Inputs: A0 - A5, A6 - A11 (on D4, D6, D8, D9, D10, and D12). The LattePanda has 12 analog inputs, labeled A0 through A11, all of which can also be used as digital I/O. Each pin has a 10 bit resolution (i.e. 1024 different values). By default they measure from ground to 5 volts. Serial: D0 (RX) and D1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. External Interrupts: D3 (interrupt 0), D2 (interrupt 1), D0 (interrupt 2), D1 (interrupt 3) and D7 (interrupt 4). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. PWM: D3, D5, D6, D9, D10, and D13 provide 8-bit PWM output. SPI: D16 (MOSI), D14 (MISO), D15 (SCK). LED: D13 There is a built-in LED driven by digital pin 13. When the pin's val TWI: D2(SDA), D3(SCL). Other pins on the board: Reset: Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board. How to access pinouts from Visual Studio LATTEPANDA.FIRMATA LattePanda.Firmata (https://github.com/LattePandaTeam/LattePanda-Development- Support/tree/master/LattePandaFirmata) is an open-source Firmata library provided by LattePanda, which is suitable for Windows apps developed in Visual Studio. This class allows you to control Arduino GPIO from Windows apps, with features including: ● Reading and writing to digital pins ● Reading analog inputs ● Controlling servo motors ● Sending data to devices and receiving data form devices through the I2C Bus 3 STEPS TO YOUR REMOTE ARDUINO PROJECT 1. Set up your PC...
  • Page 17 10/26/2016 Docs | LattePanda  Connect the Arduino automatically when it is true. Default value: True autoStart:  Set the maximum interval in seconds of serial connection timeout. Default time: 8 Seconds delay: CONFIGURATION public void pinMode (int pin, byte mode); Sets the mode of the specified pin as you wish Parameters  the number of the pin whose mode you wish to set pin:   ,  ,  ,  mode: Arduino.OUTPUT Arduino.INPUT Arduino.PWM Arduino.SERVO Returns None DIGITAL public void digitalWrite (int pin, byte value); Write to a digital pin that has been toggled to output mode with pinMode() method Parameters  The digital pin to write to pin:   ,  value: Arduino.HIGH Arduino.LOW Returns None public int digitalRead(int pin); Returns the last known state of the digital pin Parameters  The Arduino digital input pin...
  • Page 18 10/26/2016 Docs | LattePanda Returns None SERVO  Write the angle to specified pin which has been set the mode as Servo public void servoWrite(int pin, int angle); Parameters  Servo output pin. pin:  Angle from 0 to 180. value: Returns None I2C/TWOWIRE public void wireBegin(Int16 delay); Initiate the Wire library and join the I2C bus as a master. This should normally be called only once Parameters  the number of milliseconds to pause (ms). delay: Returns None public void wireRequest(byte slaveAddress,Int16 slaveRegister, Int16[] data,byte mode); Request I2C devices to send or receive data, then call   event to handle data when receive data. didI2CDataReveive Parameters  the 7-bit address of the device to request bytes from slaveAddress:  Specify the register that you want to store data or read data, choose   if there is empty. slaveRegister: Arduino.NONE data 1. when set the Parameter   as   ,the data such as   will be sending to devices mode Arduino.I2C_MODE_WRITE {0x00,0x01} through I2C BUS.
  • Page 19 10/26/2016 Docs | LattePanda 3. public void digitalWrite(int pin, byte value); Hardware Required: 1. LattePanda x 1 2. led x 1 (or you can use the LED attached to pin 13 on the Arduino board itself) Circuit: 1. LED inserted directly into pin 13 Code: 1. Create a new project in Visual Studio, Refer to Create a project 2. Main function code : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using LattePanda.Firmata; namespace blinkYourBoard//project name class Program http://www.lattepanda.com/docs/ 19/58...
  • Page 20 10/26/2016 Docs | LattePanda static Arduino arduino = new Arduino();//create an instance and initialize with the default parameters static void Main(string[] args) arduino.pinMode(13, Arduino.OUTPUT);//Set the digital pin 13 as output while (true) // ==== set the led on or off arduino.digitalWrite(13, Arduino.HIGH);//set the LED  on Thread.Sleep(1000);//delay a seconds arduino.digitalWrite(13, Arduino.LOW);//set the LED  off Thread.Sleep(1000);//delay a seconds Test: 1. Click Debug button to execute, the LED will start blinking. DIGITALREAD This example detects the Button state through digital pin (D0-D13). API required: 1. public Arduino(); 2. public void pinMode(int pin, byte mode); 3. public int digitalRead(int pin); Hardware Required: 1. LattePanda x 1 2. Button x 1 3. Resistor (Resistance value greater than 1KΩ) x 1 Circuit: http://www.lattepanda.com/docs/ 20/58...
  • Page 21 10/26/2016 Docs | LattePanda 1. Connect button to pin 12 as following figure shows Code: 1. Create a new project in Visual Studio, refer to Create a project 2. Main function code using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using LattePanda.Firmata; namespace buttonDemo//your project name class Program http://www.lattepanda.com/docs/ 21/58...
  • Page 22 10/26/2016 Docs | LattePanda static Arduino arduino = new Arduino();//create an instance and initialize with the default parameters static void Main(string[] args) arduino.pinMode(12, Arduino.INPUT);// Set the digital pin 12 as input int Value = arduino.digitalRead(12);// Read the state of pin 12 once. Console.WriteLine(Value); arduino.digitalPinUpdated += Arduino_digitalPinUpdated;// Add Event Listeners and call it when the digital input update. private static void Arduino_digitalPinUpdated(byte pin, byte state) Console.WriteLine(pin); Console.WriteLine(state); Test: 1. Click Debug to execute, then the screen will print the value when you push down or release the button This example assigns a pulse width modulation (PWM) value to an output pin (D3, D5, D6, D9, D10, D11) to dim or brighten an LED API Required: 1. public Arduino(); 2. public void pinMode(int pin, byte mode); 3. public void analogWrite(int pin, int state); Hardware Required: 1. LattePanda x 1 2. LED x 1 Circuit: http://www.lattepanda.com/docs/ 22/58...
  • Page 23 10/26/2016 Docs | LattePanda 1. LED connected directly into pin 11 as following figure shows Code: 1. Create a new project in Visual Studio, refer to Create a project 2. Main function code using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using LattePanda.Firmata; namespace analogWriteExample class Program static Arduino arduino = new Arduino();//create an instance and initialize with the default parameters static void Main(string[] args) arduino.pinMode(11, Arduino.PWM); while (true) http://www.lattepanda.com/docs/ 23/58...
  • Page 24 10/26/2016 Docs | LattePanda for (int i = 0; i <= 255; i++) arduino.analogWrite(11, i); Thread.Sleep(4);//delay 4ms for (int i = 255; i >= 0; i‐‐) arduino.analogWrite(11, i); Thread.Sleep(4);//delay 4ms Test: 1. Click Debug to execute, you will find the LED brightness vary form dim to bright and then back again. ANALOGREAD This example detect the value of analog pin (A0-A5) where a potentiometer is connected, and then print the value API Required: 1. public Arduino(); 2. public int analogRead(int pin); 3. public event AnalogPinUpdated analogPinUpdated; Hardware Required: 1. LattePanda x 1 2. Potentiometer x 1 Circuit: http://www.lattepanda.com/docs/ 24/58...
  • Page 25 10/26/2016 Docs | LattePanda 1. Connect the potentiometer to pin 3 as following figure shows: Code : 1. Create a new project in Visual Studio, refer to Create a project 2. Main function Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using LattePanda.Firmata; namespace analogWriteExample class Program static Arduino arduino = new Arduino();//create an instance and initialize with the default parameters http://www.lattepanda.com/docs/ 25/58...
  • Page 26 10/26/2016 Docs | LattePanda static void Main(string[] args) int Value = arduino.analogRead(3);//Read the state of pin 3 Console.WriteLine(Value); arduino.analogPinUpdated += Arduino_analogPinUpdated; ;//Add Event Listeners and call it when the analog input update. private static void Arduino_analogPinUpdated(int pin, int value) if(pin==3) Console.WriteLine(pin); Console.WriteLine(value); Test: 1. Click Debug to execute, the state of potentiometer will print when you rotate it. SERVO In this example, we will sweep the servo motor back and forth across 180 degrees. API Required: 1. public Arduino(); 2. public void pinMode(int pin, byte mode); 3. public void servoWrite(int pin, int angle); Hardware Required: 1. LattePanda x 1 2. Servo Motor x 1 Circuit: http://www.lattepanda.com/docs/ 26/58...
  • Page 27 10/26/2016 Docs | LattePanda 1. Servo inserted directly into pin D9: Code : 1. Create a new project in Visual Studio, Refer to Create a project 2. Main function code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using LattePanda.Firmata; namespace analogWriteExample class Program static Arduino arduino = new Arduino();//create an instance and initialize with the default parameters static void Main(string[] args) arduino.pinMode(9, Arduino.SERVO); while (true) http://www.lattepanda.com/docs/ 27/58...
  • Page 28 10/26/2016 Docs | LattePanda arduino.servoWrite(9, 180);//tell the servo motor go to the position in 180 degrees Thread.Sleep(1000);//delay a seconds arduino.servoWrite(9, 0);//tell the servo motor go to the position in 0 degrees Thread.Sleep(1000);//delay a seconds Test: 1. Click debug to execute, you will find the motor sweeping forth and back continuously. This example will show you how to use I2C to get the data form 3-axis accelerometer ADXL345 API Required: 1. public Arduino(); 2. public void wireBegin(Int16 delay); 3.public void wireRequest(byte slaveAddress,Int16 slaveRegister, Int16[] data,byte mode); 3. public event DidI2CDataReveive didI2CDataReveive; Hardware Required: 1. LattePanda x 1 2. ADXL345 x 1 Circuit: 1. The following is a figure describing which pins on the LattePanda should be connected to the pins on the accelerometer. http://www.lattepanda.com/docs/ 28/58...
  • Page 29 10/26/2016 Docs | LattePanda Code : 1. Create a new project in Visual Studio, Refer to Create a project 2. Main function code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using LattePanda.Firmata; namespace analogWriteExample class Program static Arduino arduino = new Arduino();//create an instance and initialize with the default parameters static void Main(string[] args) arduino.wireBegin(200); arduino.wireRequest(0x53, 0x2D, new Int16[] { 8 }, Arduino.I2C_MODE_WRITE);//Write data{8} to I2C arduino.didI2CDataReveive += Arduino_didI2CDataReveive;//did I2C Data Reveive arduino.wireRequest(0x53, 0x32, new Int16[] { 6 }, Arduino.I2C_MODE_READ_CONTINUOUSLY);//Read data form I2C data http://www.lattepanda.com/docs/ 29/58...
  • Page 30 10/26/2016 Docs | LattePanda private static void Arduino_didI2CDataReveive(byte address, byte register, byte[] data) Console.WriteLine(BitConverter.ToInt16(data, 0)); Console.WriteLine(BitConverter.ToInt16(data, 2)); Console.WriteLine(BitConverter.ToInt16(data, 4)); Test: 1. Click Debug to execute, the 3-axis acceleration data will be printing continuous. SET UP YOUR PC 1. Download Visual Studio 2015 Here (https://www.visualstudio.com/downloads/download-visual-studio-vs) http://www.lattepanda.com/docs/ 30/58...
  • Page 31 10/26/2016 Docs | LattePanda 2. Enable developer mode on your operating system SET UP THE ARDUINO http://www.lattepanda.com/docs/ 31/58...
  • Page 32 10/26/2016 Docs | LattePanda 1. Open Arduino. And select the “StandardFirmata” http://www.lattepanda.com/docs/ 32/58...
  • Page 33 10/26/2016 Docs | LattePanda 2. Select “Arduino Leonardo” 3. Select your COM port 4. Upload the sketch http://www.lattepanda.com/docs/ 33/58...
  • Page 34 10/26/2016 Docs | LattePanda 5. Upload Done! BLINK YOUR BOARD 1. Open Visual Studio 2015 and create a new app: 2. Download the LattePanda.Firmata class library (https://github.com/LattePandaTeam/LattePanda-Development- Support/tree/master/LattePandaFirmata) http://www.lattepanda.com/docs/ 34/58...
  • Page 35 10/26/2016 Docs | LattePanda 3. Add the downloaded class library to your project Open your Solution Explorer and right-click in the blank area, then add existing item. 4. Add the following code to Program.cs. Add the following two lines code before the namespace blinkYourBoard. using System.Threading; using LattePanda.Firmata; The first namespace contributes to delay and second is LattePanda.Firmata class library namespace http://www.lattepanda.com/docs/ 35/58...
  • Page 36: Project Examples

    10/26/2016 Docs | LattePanda Add the following code in the Main Function Arduino arduino = new Arduino(); arduino.pinMode(13, Arduino.OUTPUT);//Set the digital pin 13 as output while (true) // ==== set the led on or off arduino.digitalWrite(13, Arduino.HIGH);//set the LED  on Thread.Sleep(1000);//delay a seconds arduino.digitalWrite(13, Arduino.LOW);//set the LED  off Thread.Sleep(1000);//delay a seconds The complete code is as follows: 5. Finally debug your project Connect your Arduino and click Start Soon you will find the LED of your Arduino blinking Project Examples Turn a LattePanda in to a 3D Print Server Using Octoprint OctoPrint is an open source software which is designed to manage 3D printers. It enables you to control and monitor a 3D printer remotely from any web browser just as if you were sitting in front of it, even if it’s on the other side of your house, in your garage, or on the other side of the world. In addition to this it can slice models by dragging and dropping .stl or .obj http://www.lattepanda.com/docs/ 36/58...
  • Page 37 10/26/2016 Docs | LattePanda files on to the web UI and you can view print jobs in progress and create time lapses when you connect an ordinary USB webcam! In this tutorial we will discuss how to control and monitor a 3D printer remotely using OctoPrint and LattePanda. What We Need Before we begin you will need to prepare the following equipment: 1. LattePanda 2. A 3D printer (We have opted for the Overlord 3D Printer from DREAMMAKER) What is the DREAMMAKER Overlord? The DREAMMAKER Overlord is a 3D printer that is affordable, smart and stylish. It has many advantages such as: 1. A fusion of oriental classic and minimalism design 2. Up to 16 Pantone standard colors for your unique taste 3. Optimized operation on Windows/Mac OS/Linux 4. Auto calibration 5. Industrial Delta armature that enables a high level of repeated accuracy The following section will walk through how to install OctoPrint and connect your 3D printer Let’s get started: STEP 1: INSTALL OCTOPRINT To install OctoPrint follow the official tutorial: Windows https://github.com/foosel/OctoPrint/wiki/Setup-on-Windows In the tutorial you need to install Python 2.7 and Microsoft Visual C++ Compiler for Python 2.7 and then execute some command statements STEP 2: START OCTOPRINT IN A WEB BROWSER When you complete last step in the section 1, the command window will show some information as following figures show: In the lower right corner of the command window there are two URLs   and  http://127.0.0.1:5000 http://192.168.2.104:5000 They are highlighted with red rectangles in the image.
  • Page 38 10/26/2016 Docs | LattePanda The second URL is used to Connect to your 3D printer remotely from another PC on the same local Network as your LattePanda. The address 192.168.2.104 is actually your LattePanda's IP address. If the CMD window doesn't emerge the second URL, you can look for the IP address in Network and Sharing Center and attach the port number   at the end of :5000 IP address. PLEASE NOTE: 1. We recommend using Google Chrome as a browser. This has been tested in Microsoft Edge, and wasn't able to work without some further calibration. 2. Do not close the command window when you attempt to open OctoPrint in your web browser, or you will see the following figure. 3. How to Start OctoPrint When we set up OctoPrint, there is no desktop icon or launcher. How can we open it when we need to use it? Just open the directory   and find the file  , double click it. F:\OctoPrint\venv\Scripts octoprint.exe Then the familiar command window will emerge where you can find the two URLs in the lower right corner. Input the URLs in to your web browser as before. STEP 3: CONNECT TO YOUR 3D PRINTER http://www.lattepanda.com/docs/ 38/58...
  • Page 39 10/26/2016 Docs | LattePanda Log in your account (create one if you don't have one) and click Settings. Select "Printer Profiles" to add your printer. Choose your printer name and set some parameters similar to the following: http://www.lattepanda.com/docs/ 39/58...
  • Page 40 10/26/2016 Docs | LattePanda http://www.lattepanda.com/docs/ 40/58...
  • Page 41 10/26/2016 Docs | LattePanda Set the Serial Port and BaudRate as AUTO and select the Printer Profile "Overlord" that you created on the previous step When you connect to the Overlord successfully, you should see the following information. If Octoprint fails to connect try restarting your 3D printer, refresh the OctoPrint web interface or disconnect and reconnect the USB cable. STEP 4:HOW TO UPLOAD FILES AND PRINT http://www.lattepanda.com/docs/ 41/58...
  • Page 42 10/26/2016 Docs | LattePanda STEP 4:HOW TO UPLOAD FILES AND PRINT Open the OctoPrint Web interface and press the upload button in the lower left corner to upload a .gcode file. When the upload is complete, you can click the print button, then the printer will begin to print the file. You can monitor the print time elapsed, remaining print time, nozzle temperature and also pause or cancel a running job as the following figure shows: You can now open OctoPrint on other computer or phone (connected to the same local Network as your LattePanda) and log in to monitor and control your printer remotely! Feel free to contact us if you have any queries. We will give advice as soon as we can. REFERENCES 1. http://www.dfrobot.com.cn/community/thread-13090-1-1.html 2. https://github.com/foosel/OctoPrint/wiki/Setup-on-Windows 3. http://www.lattepanda.com/product-detail/?pid=2 4. http://www.dreammaker.cc/ Face Detection using OpenCV What is OpenCV OpenCV (Open Source Computer Vision) is released under a BSD license and hence it’s free for both academic and commercial use. It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed for computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library can take advantage of multi-core processing. Adopted all around the world, OpenCV has more than 47 thousand people of user community and estimated number of downloads exceeding 9 million. Usage ranges from interactive art, to mines detection, online maps and advanced robotics. Let’s get started: STEP 1:INSTALL VISUAL STUDIO 2015 AND OPENCV 1. Install Visual Studio 2015 on your computer Head over to https://www.visualstudio.com/products/visual-studio-professional-with-msdn-vs and download Visual...
  • Page 43 10/26/2016 Docs | LattePanda Studio Professional 2015. Unzip the downloaded file and double-click the 'vs_professional.exe', then the installation process will begin. 2. Install OpenCV Head over to the site: http://www.opencv.org and download the latest version of OpenCV (shown in the following figure). Choose the version according to your operating system. In this tutorial we are going to install OpenCV 3.1 using Visual Studio 2015 professional on a 64-bit system running Windows 10. Extract the downloaded OpenCV file Double click the downloaded OpenCV file, and then extract it STEP 2: SET THE ENVIRONMENT VARIABLES 1. To do this step, open the Control Panel and then System. Click the Advanced System Settings, last Environment Variables in turns as show in the following figure. http://www.lattepanda.com/docs/ 43/58...
  • Page 44 10/26/2016 Docs | LattePanda 2. Edit the PATH environment variables and Add a new environment variable, then give it the value of . Note that change the value depends on the path where you have extracted your OpenCV in F:\opencv\build\x64\vc14\bin http://www.lattepanda.com/docs/ 44/58...
  • Page 45 10/26/2016 Docs | LattePanda step 2. STEP 3: CREATE A NEW PROJECT IN VISUAL STUDIO 2015 http://www.lattepanda.com/docs/ 45/58...
  • Page 46 10/26/2016 Docs | LattePanda 1. In Visual Studio 2015, create a new project to follow the steps in turns as the following figure shows 2. Select Win32 Console Application in Visual C++, then name your project and select a directory to store it http://www.lattepanda.com/docs/ 46/58...
  • Page 47 10/26/2016 Docs | LattePanda 3. Choose the empty project and click finish 4. Add a new cpp file   http://www.lattepanda.com/docs/ 47/58...
  • Page 48 10/26/2016 Docs | LattePanda STEP 4: CONFIGURE OPENCV IN VISUAL STUDIO 2015 1. Open the Property Manager and double click Debug|Win64 2. Select "Include Directories", and give it the following values: F:\opencv\build\include F:\opencv\build\include\opencv F:\opencv\build\include\opencv2 http://www.lattepanda.com/docs/ 48/58...
  • Page 49 10/26/2016 Docs | LattePanda Remember that change the value depending on the path you have extracted your OpenCV files to in step 2. 3. Add Library Directories, give the value of . Remember that changing the values depends on F:\opencv\build\x64\vc14\lib the path where you have extracted your OpenCV in step 2 1.Add additional dependences http://www.lattepanda.com/docs/ 49/58...
  • Page 50 10/26/2016 Docs | LattePanda Copy the following item and paste it in additional Dependences blank  opencv_world310d.lib STEP 5: PASTE THE FOLLOWING CODE TO THE .CPP FILE YOUR ADDED IN STEP 4. http://www.lattepanda.com/docs/ 50/58...
  • Page 51 10/26/2016 Docs | LattePanda #include<opencv2\objdetect\objdetect.hpp> #include<opencv2\highgui\highgui.hpp> #include<opencv2\imgproc\imgproc.hpp> #include<iostream> #include<stdio.h> using namespace std; using namespace cv; string harrEye = "..\\..\\..\\resources\\harr\\haarcascade_eye_tree_eyeglasses.xml"; string harrFace = "..\\..\\..\\resources\\harr\\haarcascade_frontalface_alt.xml"; CascadeClassifier faceCascade; CascadeClassifier EyeCascade; string windownName = "Capture faces and eyes "; void detectAndDiapley(Mat frame); int main()     Mat frame;     // load the cascades     if (!EyeCascade.load(harrEye))         cout << "load harrEye failed" << endl;     if (!faceCascade.load(harrFace))         cout << "load harrFace failed" << endl;     // read the video stream     VideoCapture capture(0);     if (capture.isOpened())     {         while (true)         {             capture >> frame;             // apply the cascaders to the frame             if (!frame.empty())             {                 detectAndDiapley(frame);             }             else             {                 cout << "input video frame is empty" << endl;             }             if (waitKey(30) >= 0)break;         }     }...
  • Page 52 10/26/2016 Docs | LattePanda         for (int j = 0; j < eyes.size(); j++)         {             Point center(faces[i].x + eyes[j].x + eyes[j].width / 2, faces[i].y + eyes[j].y + eyes[j].height / 2);                 int radius = cvRound((eyes[j].width + eyes[j].height)*0.25);             Size axes(eyes[j].width / 2, 13);             ellipse(frame, center, axes, 0, 0, 360, Scalar(255, 255, 0), 2, 8, 0);         }     }     // show the faces and eyes detected     imshow(windownName, frame); STEP 6: DEBUG YOUR PROJECT Set two options as following figure shows: Press F5 to execute the face detection project, your PC camera will turn on and your face and eyes will be highlighted like REFERENCES: 1. http://www.michaelpsyllakis.com/install-opencv-on-visual-studio-2015-community-tutorial/ 2. http://docs.opencv.org/2.4/opencv_tutorials.pdf 3. http://docs.opencv.org/2.4/opencv2refman.pdf http://www.lattepanda.com/docs/ 52/58...
  • Page 53 10/26/2016 Docs | LattePanda Node-RED Node-RED (http://nodered.org) is a visual programming tool for Internet of Things. IBM is actively bringing its latest functions, including Waston and IOT service, into the toolbox ever since its acquisition. Here we are taking the advantage of the Node-RED tool and the email service to build a simple but awesome IOT control unit. You can remotely control your Arduino board by sending an email to your own account. The process roughly takes half an hour, with minimum coding required. HARDWARE LIST LattePanda SOFTWARE SETUP 1. Flash Firmata into Your Uno Board 2. Install Node-RED (http://nodered.org/docs/getting-started/installation). 3. Please follow the official Arduino documentation from Node-RED (http://nodered.org/docs/hardware/arduino). As soon as you get past the first blinking example, you can start to go to the IOT part. 4. Build Control flow Here is the simple flow setup. 5. Configure Email Node Now we can configure the email node. I am using the Microsoft office email server. If you are using other email service providers, please check your server settings for setting up an   client. imap http://www.lattepanda.com/docs/ 53/58...
  • Page 54 10/26/2016 Docs | LattePanda And also if you are using  Gmail , you need to create an application specific password for third-party application authentication. 6. Configure Function Node We need a tiny bit of code to interpret the email messages before relay that on to your Arduino board. Specifically, we are using the email's subject to control our Arduino board. Because some server may automatically attach or transform the email body content or format for better user experience (in its own opinion), it would be easier to write working code for our example using only the email subject. Here is the code javascript http://www.lattepanda.com/docs/ 54/58...
  • Page 55 10/26/2016 Docs | LattePanda msg.payload = parseInt(msg.topic); return msg; 7. Configure the Arduino LED Node You should have configured the LED node on pin 13 already if you have passed the example. But here is a screenshot just in case. http://www.lattepanda.com/docs/ 55/58...
  • Page 56: Troubleshooting And Faqs

    10/26/2016 Docs | LattePanda TEST Now you can send an email to your account, with the subject of a single digit: 1( or 0 if your pin 13 LED is already turned on). You should see the LED on the board change after about 10 or 20 seconds after you have sent the email. You can leave the email body empty, we are not going to use that part for now. However you can choose to try more tricks with the email body once you feel more confident. HOW IT WORKS According to Node-RED documentation, the email node will try to get your latest email from the given mail folder between the given time interval. It will notice any new email, and pass on email information to our logical function. Then our function tries to interpret the subject to an integer and fill in the data our Arduino output pin needs. Finally the Arduino pin node controls the board using firmata protocol and changes the LED status. Troubleshooting & FAQs How do I know LattePanda is on? There is one LED under LattePanda. When LP is on, you should see the PWR LED light up continuous and bright. How do I re-install LattePanda Windows system? A simple solution is useful for the following situation: 1. You can't startup your Windows system properly http://www.lattepanda.com/docs/ 56/58...
  • Page 57 Docs | LattePanda 2. Windows system crashes 3. You need to recover the default system after hacking Android or Linux. Device required: Only a USB flash drive. Please follow the simple steps below to re-install your Windows 10. 1. Format your USB disk to FAT32 and named it as "WINPE" 2. Unzip image.zip to root of USB flash disk (Download the official iso image from here): x86 version for 2G/32GB (https://drive.google.com/file/d/0B5YJ8UIGswVqeXFsbnRnWi1xXzg/view) x64 version for 4G/64GB (https://drive.google.com/file/d/0B5YJ8UIGswVqSm5qWF91MG1NWnc/view) Make sure that you extract the TAR to a FAT32 flash drive, labelled WINPE again. 3. Plug the USB disk in USB host 4. Power on the LattePanda 5. The system will install the image automatically. Just wait until the recovery is finished. 6. Unplug the USB disk. Enjoy hacking again. What Boot Method Does LattePanda Use? 1. LattePanda BIOS uses UEFI boot 2. As we use different Windows images for two LP versions, the BIOS's bit depth should match the image. So LattePanda 2G/32GB uses a 32bit UEFI boot and 4G/64GB uses a 64bit UEFI boot. If you are trying to install a different OS such as Linux, we have had some luck using multiarch images. We are still experimenting with this. We recommend looking on the forum (http://www.lattepanda.com/forum/viewtopic.php? f=5&t=275) for more information. Common Adapters and USB cable recommendations: Good power supply can ensure stable work of lattepanda. If you can’t start it, experience automatic shutdown and other problems in the process of using lattepanda, please check your adapter and USB cable so that whether they reach the specified requirements. 
 W e tested some common adapter and USB cable so that it is convenient for your selection. The results are shown in the table below. ADAPTER: Model: AUKEY PA-T9 (American Standard)
  • Page 58 10/26/2016 Docs | LattePanda Model: NILLKIN 5V@2A USB Adapter Test Results: available Peak current: 2.5A link: DFRobot (http://www.dfrobot.com/index.php? route=product/product&product_id=933&search=lattepanda&description=true#.V1UDL2OxhVo), Amazon (http://www.amazon.com/Adapter-Nillkin®US-Standard-Charger-Samsung/dp/B015SL0Y3I/ref=sr_1_1? ie=UTF8&qid=1465189045&sr=8-1&keywords=NILLKIN+5V+2A+USB) Model: APPLE ipad 10W usb power adapter Test Results: available Peak current: 2.8A link: Amazon (http://www.amazon.com/Apple-A1357-Power-Adapter-iPhone/dp/B008QYIMO8/ref=sr_1_1? ie=UTF8&qid=1465189264&sr=8-1&keywords=APPLE+10W++adapter) Model: JDB 5500 Test Results: available Peak current: 2.8A link: Amazon (http://www.amazon.com/Charger-JDB-Charge-Adapter-Samsung/dp/B00R26VRHA/ref=sr_1_1? ie=UTF8&qid=1465189309&sr=8-1&keywords=JDB+5500) Model: HUAWEI HW-050200C3W Test Results: available Peak current: 2.5A link: Amazon (http://www.amazon.com/Huawei-Original-Travel-Charger-Micro/dp/B017M0LNYC/ref=sr_1_1? ie=UTF8&qid=1465189465&sr=8-1&keywords=HW-050200C3W) Model: HUAWEI HW-059200CHQ Test Results: unavailable USB CABLE: Model: LattePanda Double Sided Micro USB Cable Test Results: available Wire Diameter: 0.9mm link: DFRobot (http://www.dfrobot.com/index.php? route=product/product&product_id=1430&search=lattepanda&description=true#.V1UEk2OxhVo) Model: REMAX RC-025T Test Results: available Wire Diameter: 0.8mm link: Amazon (http://www.amazon.com/REMAX-RC-025t-Charger-Charging-Smartphone/dp/B01CNG4UHW/ref=sr_1_1? ie=UTF8&qid=1465189542&sr=8-1&keywords=REMAX+RC-025T) Model: JDB 5500 Test Results: available Wire Diameter: 0.7mm...