Nano. Pi NEO Friendly. ARM Wi. KiIntroduction The Nano. Pi NEOabbreviated as NEO is another fun board developed by Friendly. ARM for makers, hobbyists and fans. Hardware Spec CPU Allwinner H3, Quad core Cortex A7 Up to 1. GHz DDR3 RAM 2. 56. MB5. 12. MB Connectivity 1. M Ethernet USB Host Type A x 1, 2. Micro. SD Slot x 1 Micro. USB OTG, for power input Debug Serial Port 4. Pin, 2. 5. 4 mm pitch pin header Audio inputoutput Port 5. Pin, 2. 0mm pitch pin header GPIO 2. It includes UART, SPI, I2. C, IO etc Power Supply DC 5. V2. A PCB Dimension 4. Working Temperature 4. Weight 1. 4gWITHOUT Pin headers OSSoftware u boot, Ubuntu. RS232 to Ethernet Connector helps to access and manage remote serial devices over Network. Share RS232 over Ethernet with a software solution by Eltima technology. US Converters are experts in serial data communication and supply USB Serial Adapters, RS232 to RS485 and RS422 Converters including Serial Wireless adapters. Core and Android. Software Featuresuboot mainline uboot released on May 2. Ubuntu. Core 1. 6. Linux 4. 1. 1. 2 rpi monitor check system status and information npi config system configuration utility for setting passwords, language, timezone, hostname, SSH and auto login,and enablingdisabling i. PWM software utility wiring. NP to access GPIO pins software utility RPi. Identifying Serial Headers. The first step is to try to identify potential candidates for serial port headers. Most serial port headers have at a minimum four pins. GPIONP to access GPIO pins networkmanager manage network system log output from serial port nano editor welcome window with basic system information and status auto login with user account pi with access to npi config sudoers include fa on first system boot file system will be automatically extended. Friendly. Elecs Nano. Hat PCM5. 10. 2A supports USB Wi. Fi module refer to Connect USB Wi. Fi to NEO supports audio recording and playing with 3. USB Host and 1. 00. M Ethernet supports Friendly. Elec Bake. Bit modules supports dynamic frequency scaling and voltage regulation relieves overheat compared to kernel Linux 3. MAC address. Ubuntu OLED mainline kernel Linux 4. Friendly. Elecs OLED module. Debian welcome window with basic system information and status. Debian for NAS Dock mainline kernel Linux 4. Friendly. Elecs NAS Dock optimized Open. Media. Vault configuration options allocated swap section. Android. Diagram, Layout and Dimension. Layout. Pin Name Linux gpio Pin Name Linux gpio. SYS3. 3. V 2 VDD5. V 3 I2. C0SDA 4 VDD5. V 5 I2. C0SCL 6 GND 7 GPIOG1. UART1TXGPIOG6 1. GND 1. 0 UART1RXGPIOG7 1. UART2TXGPIOA0 0 1. GPIOA6 6. 1. 3 UART2RTSGPIOA2 2 1. GND 1. 5 UART2CTSGPIOA3 3 1. UART1RTSGPIOG8 2. SYS3. 3. V 1. UART1CTSGPIOG9 2. SPI0MOSIGPIOC0 6. GND 2. 1 SPI0MISOGPIOC1 6. UART2RXGPIOA1 1. SPI0CLKGPIOC2 6. SPI0CSGPIOC3 6. USBAudioIR Pin Description. Nano. Pi NEONano. Pi NEO V1. 1V1. Pin Name Description Pin Name Description. VDD5. V 5. V Power Out 1 VDD5. V 5. V Power Out. USB DP1 USB1 DP Signal 2 USB DP1 USB1 DP Signal. USB DM1 USB1 DM Signal 3 USB DM1 USB1 DM Signal. USB DP2 USB2 DP Signal 4 USB DP2 USB2 DP Signal. USB DM2 USB2 DM Signal 5 USB DM2 USB2 DM Signal. GPIOL1. 1IR RX GPIOL1. IR Receive 6 GPIOL1. IR RX GPIOL1. 1 or IR Receive. SPDIF OUTGPIOA1. GPIOA1. 7 or SPDIF OUT 7 SPDIF OUTGPIOA1. GPIOA1. 7 or SPDIF OUT. MICIN1. P Microphone Positive Input 8 PCM0SYNCI2. S0LRC I2. SPCM Sample Rate ClockSync. MICIN1. N Microphone Negative Input 9 PCM0CLKI2. S0BCK I2. SPCM Sample Rate Clock. LINEOUTR LINE OUT Right Channel Output 1. PCM0DOUTI2. S0SDOUT I2. SPCM Serial Data Output. LINEOUTL LINE OUT Left Channel Output 1. PCM0DINI2. S0SDIN I2. SPCM Serial Data Input. GND 0. V 1. GND 0. V. Pin Name Description. MICIN1. P Microphone Positive Input. MICIN1. N Microphone Negative Input. LINEOUTR LINE OUT Right Channel Output. GND 0. V. 5 LINEOUTL LINE OUT Left Channel Output. UARTTXD0. 4 UARTRXD0. Note SYS3. 3. V 3. V power output VVDD5. V 5. V power inputoutput. When the external devices power is greater than the Micro. USBs the external device is charging the board otherwise the board powers the external device. The input range is 4. V 5. 6. V All pins are 3. V, output current is 5m. A For more details refer to the document Nano. Pi NEO v. 1. 3. Schematic. pdf. Dimensional Diagram. For more details refer to the document pcb file in dxf format. Get Started. Essentials You Need. Before starting to use your Nano. Pi NEO get the following items ready. Nano. Pi NEO micro. SD CardTFCard Class 1. Above, minimum 8. GB SDHC micro. USB power. A 5. V2. A power is a must A Host computer running Ubuntu 1. TF Cards We Tested. To make your Nano. Pi NEO boot and run fast we highly recommend you use a Class. GB SDHC TF card or a better one. The following cards are what we used in all our test cases presented here. San. Disk TF 8. G Class. MicroSD TF card San. Disk TF1. 28. G Micro. SDXC TF 1. 28. G Class. MBS 8. G C1. High Speed class. SD card Make an Installation TF Card. Get Image Files. Visit this link download link to download image files and the flashing utility Image Files. YYYYMMDD. img. zip Ubuntu Core with Qt Embedded Image File, Kernel Linux 3. YYYYMMDD. img. zip Ubuntu Core with Qt Embedded Image File, Kernel Linux 4. YYYYMMDD. img. zip Image File with Support for NAS Dock, Kernel Linux 4. NAS Docknanopi neoubuntu oled4. YYYYMMDD. img. zip Image File with Support for OLED Module, Kernel Linux 4. Nano. Hat OLEDFlash Utility. Windows utility for flashing Debian image. Under Linux users can use dd. Comparison of Linux 3. Linux 4. x. y Our Linux 3. Allwinner. Allwinner has done a lot of customization work which on one hand contains many features and functions but on the other hand incurs overheat issues Our Linux 4. We will keep this kernel with the latest one released by Linus Torvalds. This kernel doesnt generate heat that much and if you dont need to use VPU or GPU you can try this kernel Here is a comparison table Make Ubuntu. Core with Qt Embedded Image Card Extract the image file and win. Insert a TF cardat least 8. G into a Windows PC and run the win. On the utilitys main window select your TF cards drive, the wanted image file and click on write to start flashing the TF card. After flashing is done insert this TF card to your Nano. Pi NEO and connect the board to a 5. V2. A power NEO will be automatically powered on. If the blue LED is flashing it indicates the system is being booted. Work with Ubuntu Core with Qt Embedded. Run Ubuntu Core with Qt Embedded Insert a TF card with Ubuntu. Core image files into your Nano. Pi NEO, connect the board to a 5. V2. A power source the board will be automatically powered on. If you can see the blue LED flashing it means your board is working and Ubuntu. Core is being loaded. If you want to do kernel development you need to use a serial communication board, ie a PSU ONECOM board, which will allow you to operate the board via a serial terminal. Here is a setup where we connect a Nano. Pi NEO to a PC via the PSU ONECOM and you can power on your NEO from either the PSU ONECOM or the boards Micro. USB Ubuntu Cores User Accounts Non root User. User Name pi. Password pi. User Name root. Password fa. The system is automatically logged in as pi. You can do sudo npi config to disable auto login. Extend NEOs TF Card Section. When Ubuntu is loaded the TF cards section will be automatically extended. You can check the sections size by running the following command. Configure System with npi config. The npi config is a commandline utility which can be used to initialize system configurations such as user password, system language, time zone, Hostname, SSH switch, Auto login, hardware interfaceSerialI2. CSPIPWMI2. S and etc. Type the following command to run this utility. Here is how npi configs GUI looks like Ethernet Connection. If the Nano. Pi NEO is connected to a network via Ethernet before it is powered on it will automatically obtain an IP after it is powered up. If it is not connected via Ethernet or its DHCP is not activated obtaining an IP will fail and system will hang on for about 1. In this case you can try obtaining an IP by using the following command. Connect USB Wi. Fi to NEOOur system has support for popular USB Wi. Fi drivers. Many USB Wi. Fi modules are plug and play with our system. Here is a list of models we tested. RTL8. 18. 8CUS8. EU 8. 02. 1. 1n WLAN Adapter. RT2. 07. 0 Wireless Adapter. RT2. 87. 0RT3. 07. Wireless Adapter. RTL8. 19. 2CU Wireless Adapter. MI Wi. Fi mt. 76. If you Nano. Pi NEO is connected to a USB Wi. Fi and is powered up you can log into NEO and run the following command to check if the USB Wi. Fi is recognized. If wlan. 0 is listed it indicates your USB Wi. Arduino Lesson 6 Reading From the Serial Port. So far in our programming we have set the variables inside of the program, usually up at the top. In order to change the number of times the LEDs blink, we would change the lines of code that set those variables. This is OK for playing around, but you can see that if you want other people to use your programs you can not have them playing around with your code. You need to be able to get input from the user without modifying the code. We can do that using the Serial Port. Just like we can print information to the user using the Serial Port, we can also get information from the user using the serial port. In these exercises we will continue to use the circuit created in Arduino Lesson 3. If you need help in putting the circuit together, go back and review that lesson. Here is a diagram of the circuit we are working with. This circuit will allow you to independently control two Light Emitting Diodes from the arduino microcontroller. Also, as a reminder, here is the code we have been working with that incorporates all the things we have learned so far. I am including this code so you can look at it if you get stuck, and to serve as an example for the work you do. To learn programming though, you need to be typing in your own code, making mistakes, and then finding an correcting your mistakes. You will not learn programming if you simply go through these lessons copying and pasting my code. LEDPin9 Declare red. LEDPin an int, and set to pin 9. LEDPin1. 0 Declare yellow. LEDPin an int, and set to pin 1. On. Time2. 50 Declare red. On. Time an int, and set to 2. Off. Time2. 50 Declare red. Off. Time an int, and set to 2. On. Time2. 50 Declare yellow. On. Time an int, and set to 2. Off. Time2. 50 Declare yellow. Off. Time an int, and set to 2. Yellow. Blinks5 Number of times to blink yellow LED. Red. Blinks5 Number of times to blink red LED. String red. MessageThe Red LED is Blinking Declaring a String Variable. String yellow. MessageThe Yellow LED is Blinking Declaring a String Variable. Serial. begin1. 15. Turn on the Serial Port. Modered. LEDPin, OUTPUT Tell Arduino that red. LEDPin is an output pin. Modeyellow. LEDPin, OUTPUT Tell Arduino that yellow. LEDPin is an output pin. Serial. printlnred. Message. for int j1 jlt num. Red. Blinks jj1 Start our for loop. Serial. print You are on Blink. Serial. printlnj. Writered. LEDPin,HIGH Turn red LED on. On. Time Leave on for red. On. Time. digital. Writered. LEDPin,LOW Turn red LED off. Off. Time Leave off for red. Off. Time. Serial. Serial. printlnyellow. Message. for int j1 jlt num. Yellow. Blinks jj1 Start our for loop. Serial. print You are on Blink. Serial. printlnj. Writeyellow. LEDPin,HIGH Turn yellow LED on. On. Time Leave on for yellow. On. Time. digital. Writeyellow. LEDPin,LOW Turn yellow LED off. Off. Time Leave off for yellow. Off. Time. Serial. LEDPin9 Declare red. LEDPin an int, and set to pin 9 intyellow. LEDPin1. 0 Declare yellow. LEDPin an int, and set to pin 1. On. Time2. 50 Declare red. Yellow. Blinks5 Number of times to blink yellow LEDintnum. Red. Blinks5 Number of times to blink red LEDStringred. MessageThe Red LED is Blinking Declaring a String Variable Stringyellow. MessageThe Yellow LED is Blinking Declaring a String Variablevoidsetup Serial. Turn on the Serial Port pin. Modered. LEDPin,OUTPUT Tell Arduino that red. LEDPin is an output pin pin. Modeyellow. LEDPin,OUTPUT Tell Arduino that yellow. LEDPin is an output pinvoidloopSerial. Message forintj1 jlt num. Red. Blinks jj1 Start our for loop Serial. You are on Blink Serial. Writered. LEDPin,HIGH Turn red LED on delayred. On. Time Leave on for red. On. Time digital. Writered. LEDPin,LOW Turn red LED off delayred. Off. Time Leave off for red. Off. TimeSerial. Serial. printlnyellow. Message forintj1 jlt num. Yellow. Blinks jj1 Start our for loop Serial. You are on Blink Serial. Writeyellow. LEDPin,HIGH Turn yellow LED on delayyellow. On. Time Leave on for yellow. On. Time digital. Writeyellow. LEDPin,LOW Turn yellow LED off delayyellow. Off. Time Leave off for yellow. Off. TimeSerial. OK, look over this code and review what we have learned so far. At the top of the program we declare our variables, and we assign values to them. So far we have worked with variables of type int and type String. Then in the void loop we start our serial port, and we set our two arduino pins to OUTPUT. In the void loop we have built two for loops. LED and then one to blink the yellow LED. The parameters used in the for loop like how many times to blink and how long each blink should be are all defined at the top of the program. As we mentioned at the beginning, it is OK to start out doing things this way, but at some point you need to be getting your parameter values from the user, and not hard coding them into the program. You would like the program to ask the user how many times he would like to blink the red LED, and then ask how many times he would like to blink the yellow LED. This is really pretty easy to do, and we do it over the serial port, very similar to how we learned to print in lesson 5. In order to get input from the user, you need to make sure that you have turned your serial port on in your void setup. You do that with a Serial. You always need to have this command in your void setup if you are going to print to the serial port or read from it. Now, in order to get input from the user, you need to do three things Prompt the User for the Input. Wait for the User to Enter the Input. Read the information from the serial port. In the program above, lets say that in our void loop each time through the loop we want to prompt the user for how many times he wants the red LED to blink and then after that prompt him for how many times he wants the yellow LED to blink. In this scenario, we are now getting the parameters from the user instead of hard wiring them into the program. In this case, we still have to declare our varialbes, but we do not need to assign values to them. Hence in the example above the code. Yellow. Blinks5 Number of times to blink yellow LED. Red. Blinks5 Number of times to blink red LEDintnum. Yellow. Blinks5 Number of times to blink yellow LEDintnum. Red. Blinks5 Number of times to blink red LEDShould be taken out and replaced with. Yellow. Blinks Number of times to blink yellow LED. Red. Blinks Number of times to blink red LEDintnum. Yellow. Blinks Number of times to blink yellow LEDintnum. Red. Blinks Number of times to blink red LEDYou see, now we are only declaring our variables. We are not assigning values to them, because we will be getting the values from the user. It is important, however, that any variables that we will use still need to be declared. Now in our void loop this would be the code to get from the user the number of times he would like to blink the LED. Serial. printlnHow Many Times Do You Want the Red LED to blink Prompt User for Input. Serial. available0 Wait for User to Input Data. Red. BlinksSerial. Int Read the data the user has input Serial. How Many Times Do You Want the Red LED to blink Prompt User for Input whileSerial. Wait for User to Input Data num. Red. BlinksSerial. Int Read the data the user has input. There is a lot going on in these few lines of code, and lots of new things for you to learn, so lets unpack it pretty carefully. The first line should be familiar to you. You are just printing to the serial monitor a message to the user that you are waiting for input. In this case he will see a message asking him to put in a number. Now, we have to remember that the computer can work much faster than a person, so when a computer asks a person to do something, it is important for the computer to sit and wait for the person to complete it. This is done in the second and third lines of code above. This is an example of a while loop.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |