Benutzer-Werkzeuge

Webseiten-Werkzeuge


knowledgebase:arduinoide

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte Überarbeitung Beide Seiten der Revision
knowledgebase:arduinoide [2017/11/29 14:34]
rolex
knowledgebase:arduinoide [2017/12/12 11:57]
rolex
Zeile 12: Zeile 12:
 | for(int x = 0; x < 100; x++){println(x)} | Set x to 0, then while x is less than 100, print X and increment x by 1 | | for(int x = 0; x < 100; x++){println(x)} | Set x to 0, then while x is less than 100, print X and increment x by 1 |
 | while(statement){expression} | Keep doing expression while statement is true | | while(statement){expression} | Keep doing expression while statement is true |
-| do{statement}while(expression); | Like while loop, except expression is evaluated after statement runs once +| do{statement}while(expression); | Like while loop, except expression is evaluated after statement runs once | 
-|  +| switch(var){case X: statement break; case Y: statement  break;} | Run statement or depending on whether var is Xor a different value |
-| switch (var) {case 1: statement break; case 2: statement break; default: statement C break} | Run statement A, B or depending on whether var is 1or a different value |+
 | break; | Exit a for, while, do while loop or switch statement | | break; | Exit a for, while, do while loop or switch statement |
 | continue; | Skip rest of current iteration of for, while, or do while loop, start next iteration | | continue; | Skip rest of current iteration of for, while, or do while loop, start next iteration |
 | return value; | Terminate the function and optionally return value to the function that called it | | return value; | Terminate the function and optionally return value to the function that called it |
-| goto label; | Send the program flow to `label:` |+| goto label; |Send the program flow to `label:` |
  
 == Comparison Operators == == Comparison Operators ==
Zeile 25: Zeile 24:
 | < | Less than | | < | Less than |
 | > |Greater than | | > |Greater than |
-| <= | Less than or equal to |+<nowiki> <= </nowiki> | Less than or equal to |
 | >= | Greater than or equal to | | >= | Greater than or equal to |
  
 == Boolean Operators == == Boolean Operators ==
 | && | And | | && | And |
-| <code>||</code> | Or | +| <nowiki> || </nowiki> | Or | 
-! +Not | 
- Not + 
-Bitwise Operators +== Bitwise Operators == 
-& +And | 
- And +| <nowiki> | </nowiki>Or | 
-+Not | 
- Or +<< Bitshift left | 
-+>> Bitshift right | 
- Xor + 
-~ +== Compound Operators == 
- Not +x ++ x=x+1 | 
-<< +x -- x=x-1 | 
- Bitshift left +x +=y x=x+y | 
->> +x -=y x=x-y | 
- Bitshift right +x *=y x=x*y | 
-Compound Operators +x /=y x=x/y | 
-x ++ +x %=y x=the remainder of x/y | 
- x = x + 1 +x &=y x=x&y | 
-x -- + 
- x = x - 1 +== Constants == 
-x += y +HIGH/LOW Pin input or output voltage is high or low | 
- x = x + y +true/false Boolean values | 
-x -= y +LED_BUILTIN Pin where built-in LED is connected | 
- x = x - y +pinMode(pin, mode) Set pin to either INPUT, OUTPUT, or INPUT_PULLUP | 
-x *= y +digitalWrite(pin,value) Set pin to either HIGH or LOW| 
- x = x * y +digitalRead(pin) Read value of pin, which will be HIGH or LOW | 
-x /= y +analogReference(type) Configure refence voltage used for analog input | 
- x = x / y +analogRead(pin) Return input voltage of pin as integer between 0 and 1023 | 
-x %= y +analogWrite(pin,value) Output PWM wave to pin with duty cycle of value (between 0 and 255) | 
- x = the remainder of x / y + 
-x &= y +== Math == 
- x = x & y +min(x,y) Return the smaller of x or y | 
-|= y +max(x,y) Return the greater of x or y | 
- x = x | y +abs(x) Absolute value of x | 
-Constants +constrain(x,a,b) Limit x to the range a-b, return a or b if x is too small or too large | 
-HIGH / LOW +map(value,fromLow,fromHigh,toLow,toHigh) Map value from one range of numbers to another | 
- Pin input or output voltage is high or low +pow(a,x) Calculate a to the power of x | 
-true / false +sqrt(x) Square root of x | 
- Boolean values +sin(x) / cos(x) / tan(x) Sine, cosine and tangent of x | 
-INPUT / INPUT_PULLUP / OUTPUT +randomSeed(x) Start the pseudo-random number generator at point x | 
- Configure pin to sample voltage or provide current to other circuits +random(min,max) Generate a pseudo-random number between min (inclusive) and max (exclusive) | 
-LED_BUILTIN + 
- Pin where built-in LED is connected +== Time == 
-I/O +millis() Return milliseconds since program started | 
-pinMode(pin, mode) +micros() Return microseconds since program started | 
- Set pin to either INPUT, OUTPUT, or INPUT_PULLUP +delay(n) Pause program for n milliseconds | 
-digitalWrite(pin, value) +delayMicroseconds(n) Pause program for n microseconds | 
- Set pin to either HIGH or LOW + 
-digitalRead(pin) +\\ 
- Read value of pin, which will be HIGH or LOW +\\ 
-analogReference(type) +mehr auf [[https://www.arduino.cc/reference/en/ | Arduino Reference ]] oder in unseren Arduino Workshops
- Configure refence voltage used for analog input +
-analogRead(pin) +
- Return input voltage of pin as integer between 0 and 1023 +
-analogWrite(pin, value) +
- Output PWM wave to pin with duty cycle of value (between 0 and 255) +
-Math +
-min(x, y) +
- Return the smaller of x or y +
-max(x, y) +
- Return the greater of x or y +
-abs(x) +
- Absolute value of x +
-constrain(x, a, b) +
- Limit x to the range a-b, return a or b if x is too small or too large +
-map(value, fromLow, fromHigh, toLow, toHigh) +
- Map value from one range of numbers to another +
-pow(a, x) +
- Calculate a to the power of x +
-sqrt(x) +
- Square root of x +
-sin(x) / cos(x) / tan(x) +
- Sine, cosine and tangent of x +
-randomSeed(x) +
- Start the pseudo-random number generator at point x +
-random(min, max) +
- Generate a pseudo-random number between min (inclusive) and max (exclusive) +
-Time +
-millis() +
- Return milliseconds since program started +
-micros() +
- Return microseconds since program started +
-delay(n) +
- Pause program for n milliseconds +
-delayMicroseconds(n) +
- Pause program for n microseconds +
-Comments +
-// stuff +
- Single-line comment +
-/* many things */ +
- Multi-line comment +
knowledgebase/arduinoide.txt · Zuletzt geändert: 2017/12/19 11:38 von rolex