博客來網路書店查詢
星期五, 5月 27, 2016
組裝時的問題-馬達與感測器
Arjin Chen老師回應:
那一條是GND, 接在任一GND(接地)即可, 以你目前線色看來
綠-->5V
藍-->A0(左)/2(中)/4(右)
紫-->A1(左)/3(中)/5(右)
灰-->GND
Litamei Chen 老師回應:
您好
黑色線是接地GND
吳慧琳老師回應:
A.二個馬達二條各接IDE板GND+5V
B.感測三組四條接法一樣如下:
最左邊接5V
最右邊接GND
其他中間二個又分如下:
左感應接A0,1
中感應接A2,3
右感應接A4,5
我再補一張圖片說明感測器
星期六, 5月 21, 2016
C Sharp 上課六次的主題
理論上是有點多,所以希望上課的學員先上過C/C++初進階之後再上我的課程,比較能了解我在說甚麼。
因為書本太厚加上時間太短,所以我自己有安排主題,六天課程我的安排進度如下
第一天 數值計算、資料輸入與例外處理、條件分析
第二天 迴圈、陣列、引用VB的inputbox進行練習
第三天 亂數、ArrayList、圖片控制項的使用
第四天 兩個按鈕使用同一個函數、大量圖片使用、三個骰子遊戲
第五天 textBox能力的繼承、自己建立DLL檔案、使用者控制項轉為dll、影音播放
第六天 快顯選單、多表單、點唱機
當然如果大家之後有其他想法可以跟我說,我們上課主題可以變更。
因為書本太厚加上時間太短,所以我自己有安排主題,六天課程我的安排進度如下
第一天 數值計算、資料輸入與例外處理、條件分析
第二天 迴圈、陣列、引用VB的inputbox進行練習
第三天 亂數、ArrayList、圖片控制項的使用
第四天 兩個按鈕使用同一個函數、大量圖片使用、三個骰子遊戲
第五天 textBox能力的繼承、自己建立DLL檔案、使用者控制項轉為dll、影音播放
第六天 快顯選單、多表單、點唱機
當然如果大家之後有其他想法可以跟我說,我們上課主題可以變更。
人類繼承觀念內的子類別部分
class son1:public father1
{
public:
float money;
son1( )
{
money=father1::money*0.6;
father1::money=father1::money- money;
cout << "son1 father1 money="< cout << "son1 money="< }
};
class son2:public father1
{
public:
float money;
son2( )
{
cout << "son2 father1 money="< money=father1::money*0.4;
}
};
class grandson:public son1
{
public:
float money;
grandson( )
{
cout << "grandson father1 money="< money=son1::money*0.6;
son1::money=son1::money-money;
cout << "grandson money="<< money<< endl;
cout << "grandson son1 money="<< son1::money<< endl;
}
};
{
public:
float money;
son1( )
{
money=father1::money*0.6;
father1::money=father1::money- money;
cout << "son1 father1 money="<
};
class son2:public father1
{
public:
float money;
son2( )
{
cout << "son2 father1 money="<
}
};
class grandson:public son1
{
public:
float money;
grandson( )
{
cout << "grandson father1 money="<
son1::money=son1::money-money;
cout << "grandson money="<< money<< endl;
cout << "grandson son1 money="<< son1::money<< endl;
}
};
星期五, 5月 20, 2016
關於this
class部分
class Box { public: Box(double l=2.0, double b=2.0, double h=2.0) { cout <<"建立物件" << endl; length = l; breadth = b; height = h; } double Volume() { return length * breadth * height; } int compare(Box box) { return this->Volume() > box.Volume(); } private: double length; double breadth;
double height; };
程式流程
Box Box1(3.3, 1.2, 1.5);
Box Box2(8.5, 6.0, 2.0);
if(Box1.compare(Box2))
{
cout << "Box2 小於 Box1" <<endl;
}
else
{
cout << "Box2 大於等於 Box1" <<endl;
}
星期二, 4月 19, 2016
voctor中包含的函數用法
c.assign(beg,end)c.assign(n,elem) 將[beg; end)區間中的資料傳送資料給c。將n個elem的資料傳送資料給c。
c.at(idx) 傳回索引idx所指的資料,如果idx超越索引上限,拋出out_of_range。
c.back() 傳回最後一個資料,不檢查這個資料是否存在。
c.begin() 傳回vector中的第一個資料位址。
c.end() 指向vector中末端元素的下一個,指向一個不存在元素。
c.capacity() 返回vector中資料個數。
c.max_size() 返回vector中最大資料的數量。
c.size() 返回vector中實際資料的個數。
c.empty() 判斷vector是否為空。
c.erase(pos) 刪除pos位置的資料,傳回下一個資料的位置。
c.erase(beg,end) 刪除[beg,end)區間的資料,傳回下一個資料的位置。
c.clear() 移除vector中所有資料。
c.front() 傳回第一個資料。
get_allocator 使用構造函數返回一個資料。
c.insert(pos,elem) 在pos位置插入一個elem資料,傳回新資料位置。
c.insert(pos,n,elem) 在pos位置插入n個elem資料。無返回值。
c.insert(pos,beg,end) 在pos位置插入在[beg,end)區間的資料。無返回值。
c.pop_back() 刪除最後一個資料。
c.push_back(elem) 在尾部加入一個資料。
c.rbegin() 傳回一個逆向隊列的第一個資料。
c.rend() 傳回一個逆向隊列的最後一個資料的下一個位置。
c.resize(num) 重新指定隊列的長度。
c.reserve() 保留適當的容量。
c1.swap(c2) 與 swap(c1,c2) 將c1和c2元素互換。同一個操作。
vector 創建一個空的vector。
cvector c1(c2) 複製一個vector。
vector c(n) 創建一個vector,含有n個資料。
ector c(n, elem) 創建一個含有n個elem資料的vector。
vector c(beg,end) 創建一個以[beg;end)區間的vector。
c.~ vector () 銷毀所有資料,釋放內存。
operator[] 返回vector中指定位置的一個引用。
c.at(idx) 傳回索引idx所指的資料,如果idx超越索引上限,拋出out_of_range。
c.back() 傳回最後一個資料,不檢查這個資料是否存在。
c.begin() 傳回vector中的第一個資料位址。
c.end() 指向vector中末端元素的下一個,指向一個不存在元素。
c.capacity() 返回vector中資料個數。
c.max_size() 返回vector中最大資料的數量。
c.size() 返回vector中實際資料的個數。
c.empty() 判斷vector是否為空。
c.erase(pos) 刪除pos位置的資料,傳回下一個資料的位置。
c.erase(beg,end) 刪除[beg,end)區間的資料,傳回下一個資料的位置。
c.clear() 移除vector中所有資料。
c.front() 傳回第一個資料。
get_allocator 使用構造函數返回一個資料。
c.insert(pos,elem) 在pos位置插入一個elem資料,傳回新資料位置。
c.insert(pos,n,elem) 在pos位置插入n個elem資料。無返回值。
c.insert(pos,beg,end) 在pos位置插入在[beg,end)區間的資料。無返回值。
c.pop_back() 刪除最後一個資料。
c.push_back(elem) 在尾部加入一個資料。
c.rbegin() 傳回一個逆向隊列的第一個資料。
c.rend() 傳回一個逆向隊列的最後一個資料的下一個位置。
c.resize(num) 重新指定隊列的長度。
c.reserve() 保留適當的容量。
c1.swap(c2) 與 swap(c1,c2) 將c1和c2元素互換。同一個操作。
vector 創建一個空的vector。
cvector c1(c2) 複製一個vector。
vector c(n) 創建一個vector,含有n個資料。
ector c(n, elem) 創建一個含有n個elem資料的vector。
vector c(beg,end) 創建一個以[beg;end)區間的vector。
c.~ vector () 銷毀所有資料,釋放內存。
operator[] 返回vector中指定位置的一個引用。
訂閱:
文章 (Atom)




