2015年11月11日 星期三

[Arduino]參考資料

[Arduino] setup() loop() 不在*.ino草稿檔中,如何做?

一般而言在Arduino中,開啟新檔後,就會在其INO檔中看到setup()及loop()這二個函數

例如:
Blink.ino 內容如下:
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

本文打算要來把setup和loop這二個函數搬位置,應該如何實現呢?
在開啟新的arduino檔案時,會有一個INO檔
我們可以加入其它的檔案,如*.h的標頭檔,或是*.cpp的檔

2015年11月8日 星期日

RamPs1.4 基本組裝與步進馬達測試

RamPs1.4 基本組裝與步進馬達測試
1、安裝好Arduino IDE程式,並裝好Aduino Mega 2560的驅動程式
2、將RamPs1.4模組組裝到Mega 2560上,並將RamPs1.4上的步進馬達Jumpper選擇至所需的檔位
3、插入A4988步進馬達驅動器組裝至RamPs1.4上。請注意方向

2015年11月1日 星期日

[Arduino] 指令表 (出自於www.arduino.cc)

出處:https://www.arduino.cc/en/Reference/HomePage

Structure

Control Structures

Further Syntax

Arithmetic Operators

  • = (assignment operator)
  •  (addition)
  • - (subtraction)
  • * (multiplication)
  • / (division)
  • % (modulo)

Comparison Operators

  • == (equal to)
  • != (not equal to)
  • < (less than)
  • > (greater than)
  • <= (less than or equal to)
  • >= (greater than or equal to)

Boolean Operators

  • && (and)
  • || (or)
  • ! (not)

Pointer Access Operators

Bitwise Operators

  • & (bitwise and)
  • | (bitwise or)
  • ^ (bitwise xor)
  • ~ (bitwise not)
  • << (bitshift left)
  • >> (bitshift right)

Compound Operators

  • ++ (increment)
  • -- (decrement)
  • += (compound addition)
  • -= (compound subtraction)
  • *= (compound multiplication)
  • /= (compound division)
  • %= (compound modulo)
  • &= (compound bitwise and)
  • |= (compound bitwise or)

Variables

Constants

Data Types

Conversion

Variable Scope & Qualifiers

Utilities

Functions

Digital I/O

Analog I/O

Due & Zero only

Advanced I/O

Time

Math

Trigonometry

Characters

Random Numbers

Bits and Bytes

External Interrupts

Interrupts

Communication

USB (32u4 based boards and Due/Zero only)