Відмінності між версіями «Програмування»
Матеріал з мікроАмпер
Oogway (обговорення • внесок) |
Oogway (обговорення • внесок) |
||
| Рядок 204: | Рядок 204: | ||
| | | | ||
| | | | ||
| + | |<font style="color: #ef553b">Символи</font> | ||
|- | |- | ||
|<font style="color: #ef553b">Вказівники доступу</font> | |<font style="color: #ef553b">Вказівники доступу</font> | ||
| + | | | ||
| + | |isAlphaNumeric() | ||
| + | |- | ||
| | | | ||
| | | | ||
| + | |isAlpha() | ||
|- | |- | ||
| + | |* dereference operator | ||
| | | | ||
| + | |isAscii() | ||
| + | |- | ||
| + | |& reference operator | ||
| | | | ||
| + | |isWhitespace() | ||
| + | |- | ||
| | | | ||
| + | | | ||
| + | |isControl() | ||
|- | |- | ||
| − | | | + | |<font style="color: #ef553b">Бітові оператори</font> |
| | | | ||
| + | |isDigit() | ||
| + | |- | ||
| | | | ||
| + | | | ||
| + | |isGraph() | ||
|- | |- | ||
| − | |& | + | |& (bitwise and) |
| | | | ||
| + | |isLowerCase() | ||
| + | |- | ||
| + | |<nowiki>| (bitwise or)</nowiki> | ||
| | | | ||
| + | |isPrintable() | ||
|- | |- | ||
| + | |^ (bitwise xor) | ||
| | | | ||
| + | |isPunct() | ||
| + | |- | ||
| + | |~ (bitwise not) | ||
| | | | ||
| + | |isSpace() | ||
| + | |- | ||
| + | |<< (bitshift left) | ||
| | | | ||
| + | |isUpperCase() | ||
|- | |- | ||
| − | | | + | |>> (bitshift right) |
| + | | | ||
| + | |isHexadecimalDigit() | ||
| + | |- | ||
| + | | | ||
| | | | ||
| | | | ||
|- | |- | ||
| + | |<font style="color: #ef553b">Складені оператори присвоєння</font> | ||
| | | | ||
| + | |<font style="color: #ef553b">Випадкові числа</font> | ||
| + | |- | ||
| + | | | ||
| | | | ||
| | | | ||
|- | |- | ||
| − | | | + | |<nowiki>++ (increment)</nowiki> |
| | | | ||
| + | |randomSeed() | ||
| + | |- | ||
| + | |<nowiki>-- (decrement)</nowiki> | ||
| | | | ||
| + | |random() | ||
|- | |- | ||
| − | |<nowiki> | + | |<nowiki>+= (compound addition)</nowiki> |
| | | | ||
| | | | ||
|- | |- | ||
| − | | | + | |<nowiki>-= (compound subtraction)</nowiki> |
| + | | | ||
| + | |<font style="color: #ef553b">Біти та байти</font> | ||
| + | |- | ||
| + | |<nowiki>*= (compound multiplication)</nowiki> | ||
| | | | ||
| | | | ||
|- | |- | ||
| − | | | + | |<nowiki>/= (compound division)</nowiki> |
| | | | ||
| + | |lowByte() | ||
| + | |- | ||
| + | |<nowiki>%= (compound modulo)</nowiki> | ||
| | | | ||
| + | |highByte() | ||
|- | |- | ||
| − | |< | + | |<nowiki>&= (compound bitwise and)</nowiki> |
| | | | ||
| + | |bitRead() | ||
| + | |- | ||
| + | |<nowiki>|= (compound bitwise or)</nowiki> | ||
| | | | ||
| + | |bitWrite() | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | |bitSet() | ||
|- | |- | ||
| | | | ||
| | | | ||
| + | |bitClear() | ||
| + | |- | ||
| | | | ||
| + | | | ||
| + | |bit() | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | | | ||
|- | |- | ||
| | | | ||
| + | | | ||
| + | |<font style="color: #ef553b">Зовнішні переривання</font> | ||
| + | |- | ||
| + | | | ||
| | | | ||
| | | | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | |attachInterrupt() | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | |detachInterrupt() | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | | | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | |<font style="color: #ef553b">Переривання</font> | ||
|- | |- | ||
| − | | | + | | |
| | | | ||
| | | | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | |interrupts() | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | |noInterrupts() | ||
|- | |- | ||
| − | |||
| | | | ||
| | | | ||
| + | | | ||
|- | |- | ||
| − | |||
| | | | ||
| + | | | ||
| + | |<font style="color: #ef553b">Комунікація</font> | ||
|- | |- | ||
| + | | | ||
| | | | ||
| + | | | ||
| + | |- | ||
| + | | | ||
| + | | | ||
| + | |Serial | ||
| + | |- | ||
| + | | | ||
| + | | | ||
| + | |Stream | ||
| + | |- | ||
| + | | | ||
| + | | | ||
| + | | | ||
| + | |- | ||
| + | | | ||
| + | | | ||
| + | |<font style="color: #ef553b">USB (Лише для Due/Zero та плат на 32u4)</font> | ||
| + | |- | ||
| + | | | ||
| + | | | ||
| + | | | ||
| + | |- | ||
| + | | | ||
| + | | | ||
| + | |Keyboard | ||
| + | |- | ||
| | | | ||
| | | | ||
| + | |Mouse | ||
|- | |- | ||
Версія за 15:41, 22 червня 2016
Мова програмування Arduino має три головні розділи: структура, дані (змінні та константи) і функції.
| Структура | Дані | Функції |
|
Константи | Цифрове введення/виведення |
| loop() | ||
| LOW | pinMODE() | |
| Оператори керування | OUTPUT | INPUT_PULLUP | digitalWrite() |
| LED_BUILTIN | digitalRead() | |
| if | false | |
| if...else | integer constants | Analog I/O |
| for | floating point constants | |
| switch case | analogReference() | |
| while | Типи даних | analogRead() |
| do... while | analogWrite() - PWM | |
| break | void | |
| continue | boolean | Лише для Due & Zero |
| return | char | |
| goto | unsigned char | analogReadResolution() |
| byte | analogWriteResolution() | |
| Синтаксис | int | |
| unsigned int | Розширене введення/виведення | |
| ; (semicolon) | word | |
| {} (curly braces) | long | tone() |
| // (single line comment) | unsigned long | noTone() |
| /* */ (multi-line comment) | short | shiftOut() |
| #define | float | shiftIn() |
| #include | double | pulseIn() |
| string - char array | ||
| Арифметичні оперетори | String - object | Час |
| array | ||
| = (assignment operator) | millis() | |
| + (addition) | Перетворення типів | micros() |
| - (subtraction) | delay() | |
| * (multiplication) | char() | delayMicroseconds() |
| / (division) | byte() | |
| % (modulo) | int() | Математичні дії |
| word() | ||
| Оператори порівняння | long() | min() |
| float() | max() | |
| == (equal to) | abs()- | |
| != (not equal to) | Область видимості змінної та специфікатори | constrain() |
| < (less than) | map() | |
| > (greater than) | variable scope | pow() |
| <= (less than or equal to) | static | sqrt() |
| >= (greater than or equal to) | volatile | |
| const | Тригонометрія | |
| Оператори Boolean | ||
| Допоміжні функції | sin() | |
| && (and) | cos() | |
| || (or) | sizeof() | tan() |
| ! (not) | PROGMEM | |
| Символи | ||
| Вказівники доступу | isAlphaNumeric() | |
| isAlpha() | ||
| * dereference operator | isAscii() | |
| & reference operator | isWhitespace() | |
| isControl() | ||
| Бітові оператори | isDigit() | |
| isGraph() | ||
| & (bitwise and) | isLowerCase() | |
| | (bitwise or) | isPrintable() | |
| ^ (bitwise xor) | isPunct() | |
| ~ (bitwise not) | isSpace() | |
| << (bitshift left) | isUpperCase() | |
| >> (bitshift right) | isHexadecimalDigit() | |
| Складені оператори присвоєння | Випадкові числа | |
| ++ (increment) | randomSeed() | |
| -- (decrement) | random() | |
| += (compound addition) | ||
| -= (compound subtraction) | Біти та байти | |
| *= (compound multiplication) | ||
| /= (compound division) | lowByte() | |
| %= (compound modulo) | highByte() | |
| &= (compound bitwise and) | bitRead() | |
| |= (compound bitwise or) | bitWrite() | |
| bitSet() | ||
| bitClear() | ||
| bit() | ||
| Зовнішні переривання | ||
| attachInterrupt() | ||
| detachInterrupt() | ||
| Переривання | ||
| interrupts() | ||
| noInterrupts() | ||
| Комунікація | ||
| Serial | ||
| Stream | ||
| USB (Лише для Due/Zero та плат на 32u4) | ||
| Keyboard | ||
| Mouse |
