![]() ![]() Note : if your computer has no RS232 DB9 male head, you may need an USB to RS232 DB9 male head convertor as well. Here we take the Type 2 Console Cable which is used for TP-Link products on shipment now as example to introduce the line sequence and its corresponding relationship of the RS232 DB9 female head and the RJ45 head. We highly recommend you to use the original Console Cable that comes with the product, but if you lost the Console Cable by accident and need to use a third-part Console Cable or make one by yourself, please make sure the line sequence of the cable’s connectors is correct. Type 2: RS232 DB9 Female Head RJ45 connector Note: this kind of Console Cable is used for some old version TP-Link products that is discontinued now. Type 1: RS232 DB9 Male Head RS232 DB9 Female Head There are many kinds of Console cable in the market, the main two types of Console cable that TP-Link uses is shown in the pictures below: Serial.The Console Cable is used for the serial connection between your computer’s serial port and the console port on your TP-Link switch or router to access the CLI (Command Line Interface) of the device. make sure that you use the pins your buttons are wired to this declares each of our buttons and their pins This can be a great way to expand your coding knowledge. We’ve added comments to each line to make it easier to understand, but we encourage you to look up and read about anything that you don’t recognize. Once you have all of this code in place, your finished program should look like the code below. Our if statement checks the state of the button using the built-in digitalRead function. This function can only check on button at a time, using the variable it gets from the main loop function so that it knows which button the check. void checkPush ( int pinNumber)įollowing this, we need to assign the variable we are using and create an if statement to detect when each button is pressed. To start, we need to declare our function with an integer variable like the code below. ![]() Create a project using android SDK script: > android create project -target 3 -name MyHello -path. Here, I only list the steps to build a project by command line tools but it is perfectly OK to build a project by Eclipse. This next stage is more complex than the others, as we will be creating our own function that will be dealing with a variable from the main loop function. Lets start writing a console app so as to consolidate your experience with it. PinMode(input1Pin, INPUT) // these lines declare each of the buttons as an input Serial.begin( 57600) // this begins the serial connection with a baud rate of 57600 This is all we need in our void setup() function. Note: This section assumes you are using the Retail API for your Recommendations AI project, and want to use the. First, we will start our serial connection with a baud rate of 57600, followed by the initialization of our buttons. Switch your project to the Retail console. Int input1Pin = 2 Setting Up the ButtonsĪs with most Arduino projects, we will be using a function that will run once at the beginning of the program, called void setup(). This should be placed at the top of your Arduino project, before any of the functions. NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0 it is referred to as the Command Processor Shell. Seeing as we used Digital Pins 2, 3, 4, and 5, these are the pins we will declare with our code. Command Prompt, also known as cmd.exe or cmd, is the default command-line interpreter for the OS/2, eComStation, ArcaOS, Microsoft Windows (Windows NT family and Windows CE family), and ReactOS operating systems. Assigning Buttons to Pinsįor the first step, we need to assign our buttons to the different pins on our Arduino board. The code for the project is nice and simple, without the need for any class libraries or other complicated programming. Programming Multiple Push-Buttons With an Arduino
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |