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)

2015年10月31日 星期六

[Arduino] C前置處理

 C 前置處理

對於一個 C 程式 編譯之前, C 編譯器 會先處理 C 程式 中含有
 #define、#undef、#if、#ifdef、#ifndef、#endif、#elif、#else 及 #include 敘述, 將之置換成一新 C 程式, 再將之編譯 成一 assembly 程式, 再轉成 machine code(或 object code)。 再經由 linker 變成一執行檔。

2014年9月8日 星期一

ASUS 筆電 BIOS 無法選擇 光碟 USB 開機

為了配合win8  華碩筆記型電腦修改 BIOS 選項
以配合 win8 boot manager
若要改回 光碟開機 需修改設定

狀況:
1、按ESC無法選擇其它地方開機:如USB随身碟或硬碟、光碟機
2、在進入BIOS後,在BOOT選項中無法看到其它可開機的媒體

筆電按開機鈕後,請馬上反覆狂按F2鍵先進BIOS裡面

(1)進BIOS後切換到最後面的 "Boot" 選單內將 "Lunch CSM"  設定為 Enabled
(2)再切換到 "Security" 選單將 "Secure Boot Control" 設定為Disabled
(3)按F10儲存後,重開後一直按"Esc"會出現開機選單,就會出現選硬碟及光碟了
(4)或是再次進入BIOS後,則可出現其它開機選項,再調整開機順序即可

2014年9月7日 星期日

window8,AUSU筆電無法還原的解決辦法

最近遇到ASUS華碩筆電要還原的問題


選擇重新整理電腦時會出現:"安裝Windows的磁碟機已被鎖定請解除鎖定的磁碟機,然後再試一次"
而選擇重設時則跑出:"缺少必要的磁碟機磁碟分割"