The assignment consists of the designing a board. This board has a button and a LED in it. Here you can see the Video where you´ll see the "schematics" of many boards, including the embedded board EAGLE |
|||||||||||||||||||||||
const int buttonPin = 5; |
CONST INT LEDPIN means the number of the pin of LED. The CONST keyword stands for constant. It is a variable qualifier that modifies the behavior of the variable, making a variable "read-only". This means that the variable can be used just as any other variable of its type, but its value cannot be changed. You will get a compiler error if you try to assign a value to a CONST variable VOID SETUP. This function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. PINMODE. Configures the specified pin to behave either as an input or an output. See the description of digital pins for details on the functionality of the pins. The pin: the number of the pin whose mode you wish to set. The mode: INPUT, OUTPUT, or INPUT PULLUP. VOID LOOP. After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. BUTTON STATE turn on and turn off. "IF" is used in conjunction with a comparison operator, tests whether a certain condition has been reached, such as an input being above a certain number. DIGITALWRITE includes pin (pin number) and value (HIGH or LOW).
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
This is the schematic, made in EAGLE Click the "Скачать" button for downloading |
|||||||||||||||||||||||
The original code is this one:
|
//Include Files |