顯示具有 01161001_林思汝 標籤的文章。 顯示所有文章
顯示具有 01161001_林思汝 標籤的文章。 顯示所有文章

2015年1月22日 星期四

期末作品 -遙控車

期末作品: 遙控車


透過手機藍芽傳訊號給藍芽模組後,讓模型車體可以依手機打的指令分別:  前進,後退,轉彎。



操作說明:
在手機輸入指令:        


                                     f,100                         前進 ,速度:100   
                                     b,200                        後退,速度:200      
                                     a,20                           轉20度






過程:                     


將HC-06 藍芽模組的 :  VCC   分別用電線接到 ----->  Arduino Uno版子:   5 V
   將HC-06 藍芽模組的 :  GND   分別用電線接到 ----->  Arduino Uno版子:   GND
            將HC-06 藍芽模組的 :  TXD   分別用電線接到 ----->  Arduino Uno版子:   Pin 10(RX)
             將HC-06 藍芽模組的 : RXD   分別用電線接到 ----->  Arduino Uno版子:   Pin 11(TX)
                                



                                       通電後,藍芽模組開始亮紅燈。(測試線路)




接完藍芽模組的線路後,接著拔掉藍芽模組,並將L293D模組疊在上方,接著伺服馬達也接在在上面,並將USB線插入Arduino的插孔與電腦上。    




執行編譯Arduino 程式後




                                            接著將程式上傳到Arduino版上。



                                                將藍芽模組接在剛剛已經設好的線路上。





                                         
                                          連通後藍芽模組開始閃紅燈。




                                     
開啟手機的藍芽,並與藍芽模組 配對。

點入App中

搜尋藍芽,並配對藍芽。





                                          將手機藍芽與該藍芽模組的藍芽配對後,並在上面輸入指令,
                                          " a,50"  讓伺服馬達轉50度。
                           




測試減速馬達是否正常運轉,測試結果為正常。




但與 L293D模組接好後,卻無法運轉,初步判斷可能是線路差反,確定線路的正負沒錯後,
詢問過他人的想法後,在猜想有可能是馬達的電壓 9 V  與 Arduino 版的供電數 有關。



參考資料:    

                                 Arduino 從基礎到實踐 / Michael McRoberts著 ; 杨继志, 郭敬译




                                             







車子模型



2014年12月8日 星期一

Week13課堂作業

1. 利用 Serial (USB 的 Serial) 來將Arduino的按鍵、旋鈕, 得到輸入值, 都傳給電腦做處理







Serial.print() 指令

                                      接下來, 將按鈕 (pin2) 按下去Hello, 沒按HI




2. 利用 Serial (USB 的 Serial) 來由電腦 控制 Arduino 的輸出



2014年12月1日 星期一

Week12課堂作業

Button




沒按Button(不會亮)


按Button(會亮)





Play a Melody using the tone() function
















void setup(){
  pinMode(2,INPUT_PULLUP);
  pinMode(13,OUTPUT);
}
void loop(){
  if(digitalRead(2)==HIGH){
    digitalWrite(13,HIGH);
    tone(8,440,300);
  }else{
    digitalWrite(13,LOW);
    noTone(8);
  }
}

2014年11月24日 星期一

Week10業師 胡啟彥

今天的業界老師(艾迪斯科技胡啟彥先生),他所演講的內容大多是在介紹它們科技團隊所參與的專案,老師讓我們看每一個專案製作的過程,從選場地到機器的測試,每一個步驟都不能馬虎,不能有一絲一毫的差錯,所以每一個專案所呈現的效果也讓人為之一亮。
而老師的公司(艾迪斯科技),在3D虛擬科技上大多是應用在娛樂、商業和藝術,利用Unity、Kinecet、Arduino等設備去製作專案,呈現出虛擬實境的效果。
之前去過”E傳媒”,當時正好看到演員們正在拍攝動新聞,而他們身上所穿著的服裝有許多小點,而那些小點是分布在他們四肢的關節上,其小點可以偵測到暪一個關節的移動,而艾迪斯科技也有利用這些設備去運用在電影動畫上。
系上也有一些課程是教Unity、Kinecet、Arduino,我沒有想過能利用這些東西做出這麼好的作品,我覺得在學習得方面上也要下很大的功夫吧!想想現在也不知不覺就大三了,不像大一時還懵懵懂懂的,我想要比別人過得更充實,就不要再浪費多餘的時間,而且要盡早了解自己所喜歡的東西,然後往那個目標邁進。

最後,很謝謝業界老師的演講,也讓我對互動技術有更進一步的了解。

week08業師 曾煒傑

今天難得請業界老師來班上演講,而且是一位年輕的創辦人曾煒傑先生,他所創辦的公司叫"叁式",聽完老師的講解後,讓我覺得互動藝術真的是現在的趨勢,不但可以吸引更多人注意,還可以將作品推廣的更有效率,最吸引我的還是用在商業或行銷的互動廣告,能把廣告拍的觸動人心真的是一件不容易的事。
老師放了很多他們團隊所做出的作品,幾乎都是和品牌合作的案子,第一次看到程式和設計結合起來可以做出這麼好的作品,廣告呈現的感覺也很好,讓人看了會牢牢記在腦子裡的感覺,老師也講了,每一個品牌呈現的廣告,都缺少不了最初的宗旨和意義,就是可口可樂的每一個廣告,裡頭都缺少不了”分享”的元素,這種行銷手法才是會讓人過目不忘的。
聽完曾煒傑先生的演講後,我覺得感觸很多,覺得很多東西都是要靠努力,一點一滴去完成、去實踐,才會有好的收穫,雖然過程會比別人還艱辛,但得到的收穫一定不會比別人少,我覺得要做出一件好的作品,不只要具備一些基本的學術能力,最重要的還是那顆熱血的心。

最後,最重要的還是謝謝小葉老師請業師來班上進行演講,希望以後不管在哪一門課也會有這種機會可以多聽一些業界老師分享的經驗。

Week11課堂作業






void setup() {              
  // initialize the digital pin as an output.
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(300);               // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(12, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(300);               // wait for a second
  digitalWrite(12, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(11, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(300);               // wait for a second
  digitalWrite(11, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(10, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(300);               // wait for a second
  digitalWrite(10, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(300);               // wait for a second
  digitalWrite(9, LOW);    // turn the LED off by making the voltage LOW

}




2014年10月27日 星期一

Week07期中作品展示

期中作品

殺螞蟻遊戲Demo



遊戲介紹:

    我做的是殺螞蟻的遊戲,程式執行後遊戲即開始,螞蟻會從視窗下方跑出來,可以用滑鼠的殺蟲劑去消滅,每消滅一隻就會得五分,如果沒消掉讓螞蟻跑走就會扣五分,遊戲時間60秒,結束後會出現你所獲得的成績。


程式:

int antx=0, anty=0, anty1=0, anty2=0;
int score=0;//分數
int lasttime=60;//時間
PImage imgBG, imgHANT, imgUP, ant;//背景、殺蟲劑、螞蟻
void setup(){
  size(380,600);
  ant = loadImage("ant.png");
  imgHANT = loadImage("hant.png");
  imgBG = loadImage("BG.png");
  imgBG.resize(380, 600);
  imgUP = loadImage("up.png");
  imgSTOP = loadImage("stop.png");
  imgSTOP.resize(50, 50);
  imageMode(CENTER);
}
void draw(){
  background(imgBG);
  image(imgHANT, mouseX, mouseY, 120, 60);
  image(imgUP, 190, 20);
  image(imgSTOP, 190, 20);


  anty-=3;
  image(ant,antx+300,anty+600,80,80);
  if(anty+600<0)
  {
    score-=5;
    anty=0;
  }
  anty1-=2;
  image(ant,antx+200,anty1+500,80,80);
  if(anty1+500<0)
  {
    score-=5;
    anty1=0;
  }
  anty2-=3;
  image(ant,antx+100,anty2+700,80,80);
  if(anty2+700<0)
  {
    score-=5;
    anty2=0;
  }

  world();
}
void mousePressed(){
  if (mouseX > antx+300 && mouseX< antx+400 && mouseY<anty+700 && mouseY>anty+600)
   {
     anty=600;
     score+=5;
   }

  if (mouseX > antx+200 && mouseX< antx+300 && mouseY<anty1+600 && mouseY>anty1+500)
   {
   anty1=500;
   score+=5;
   }
  if (mouseX > antx+100 && mouseX< antx+200 && mouseY<anty2+800 && mouseY>anty2+700)
   {
   anty2=700;
   score+=5;
   }
}
void world()
  {
     textFont(createFont("Georgia", 30));
      fill(255);
  text("score:"+score, 25, 30);

  textFont(createFont("Georgia", 30));
      fill(255);
  text("Time:"+lasttime, 250, 30);
  lasttime=60-millis()/1000;

      if(lasttime==0)
      {
      stop();
      textFont(createFont("Georgia", 40));
      background(#FAC17C);
      fill(255,255,255);
      text("Game Over",80,200);
      text("Your score:"+score,40,250);
   
      }
  }

2014年10月20日 星期一

Week06-期中作品

期中作品

            殺螞蟻遊戲

程式Demo↓






int antx=0, anty=0, anty1=0, anty2=0;
int score=0;
int lasttime=60;
PImage imgBG, imgHANT, imgUP, imgSTOP, imgSTART, ant;
void setup(){
  size(380,600);
  ant = loadImage("ant.png");
  imgHANT = loadImage("hant.png");
  imgBG = loadImage("BG.png");
  imgBG.resize(380, 600);
  imgUP = loadImage("up.png");
  imgSTOP = loadImage("stop.png");
  imgSTOP.resize(50, 50);
  imageMode(CENTER);
}
void draw(){
  background(imgBG);
  image(imgHANT, mouseX, mouseY, 120, 60);
  image(imgUP, 190, 20);
  image(imgSTOP, 190, 20);

  anty-=3;
  image(ant,antx+300,anty+600,80,80);
  if(anty+600<0)
  {
    score-=5;
    anty=0;
  }
  anty1-=2;
  image(ant,antx+200,anty1+500,80,80);
  if(anty1+500<0)
  {
    score-=5;
    anty1=0;
  }
  anty2-=3;
  image(ant,antx+100,anty2+700,80,80);
  if(anty2+700<0)
  {
    score-=5;
    anty2=0;
  }
  world();
}
void mousePressed(){
  if (mouseX > antx+300 && mouseX< antx+400 && mouseY<anty+700 && mouseY>anty+600)
   {
     anty=600;
     score+=5;
   }

  if (mouseX > antx+200 && mouseX< antx+300 && mouseY<anty1+600 && mouseY>anty1+500)
   {
   anty1=500;
   score+=5;
   }
  if (mouseX > antx+100 && mouseX< antx+200 && mouseY<anty2+800 && mouseY>anty2+700)
   {
   anty2=700;
   score+=5;
   }
}
void world()
  {
     textFont(createFont("Georgia", 30));
      fill(255);
  text("score:"+score, 25, 30);

  textFont(createFont("Georgia", 30));
      fill(255);
  text("Time:"+lasttime, 250, 30);
  lasttime=60-millis()/1000;

      if(lasttime==0)
      {
      stop();
      textFont(createFont("Georgia", 40));
      background(#FAC17C);
      fill(255,255,255);
      text("Game Over",80,200);
      text("Your score:"+score,40,250);
   
      }

  }

2014年10月13日 星期一

Week05-期中作品

期中作品

                    殺螞蟻遊戲


1.1 先把背景設定好


1.2 找一張殺蟲劑的圖片套用在裡面


1.3

2014年10月6日 星期一

Week04


會移動的花

void setup(){
  size(600,400);
}
void draw(){
  translate(mouseX,mouseY);
  fill(#FFA2F6);ellipse(0,0,80,180);
  rotate(PI/4);
  fill(#FFA2F6);ellipse(0,0,80,180);
  rotate(PI/4);
  fill(#FFA2F6);ellipse(0,0,80,180);
  rotate(PI/4);
  fill(#FFA2F6);ellipse(0,0,80,180);
  rotate(PI/4);
  fill(#FFF4A2);ellipse(0,0,80,80);
}

會轉動的花
void setup(){
  size(600,400);
}
void draw(){
  translate(mouseX,mouseY);
  rotate(0.01*frameCount);
  fill(#FFA2F6);ellipse(0,0,80,180);
  rotate(PI/4);
  fill(#FFA2F6);ellipse(0,0,80,180);
  rotate(PI/4);
  fill(#FFA2F6);ellipse(0,0,80,180);
  rotate(PI/4);
  fill(#FFA2F6);ellipse(0,0,80,180);
  rotate(PI/4);
  fill(#FFF4A2);ellipse(0,0,80,80);
}


void setup(){
  size(600,400);
}
void draw(){
  translate(mouseX,mouseY);
  rotate(0.01*frameCount);
  for(int i=0;i<20;i++){
    fill(#FFA2F6);ellipse(0,0,18,180);
    rotate(PI/20);
  }
  fill(#FFF4A2);ellipse(0,0,80,80);
}

void setup(){
  size(600,400);
  colorMode(HSB,600,400,400);
}
void draw(){
  fill(mouseX,mouseY,400);
  translate(mouseX,mouseY);
  rotate(0.01*frameCount);
  for(int i=0;i<4;i++){
    ellipse(0,0,80,180);
    rotate(PI/4);
  }
  fill(#FF7C17);ellipse(0,0,80,80);
}

-------------------------------------------------------------------------------------------------------------------------
期中想做的作品
                   類似捏螞蟻的遊戲



相關影片↓

https://play.google.com/store/apps/details?id=com.bestcoolfungames.antsmasher&hl=zh_TW
https://www.youtube.com/watch?v=NxyOVIpo_qA


2014年9月29日 星期一

Week03




PImage img,imgBG;
float eggX=400,eggY=280,eggVX,eggVY,flying=0;
void setup(){
  size(800,600,P3D);
  minim = new Minim(this);
  player = minim.loadFile();
 
  img=loadImage("http://www.mariowiki.com/images/thumb/e/eb/MushroomstickerPMSS.png/500px-MushroomstickerPMSS.png");
  imgBG=loadImage("background.jpg");
  imgBG.resize(800,600);
  imageMode(CENTER);
}
void draw(){
  background(imgBG);
  image(img,mouseX,mouseY,50,50);
  if(flying>0){
    ellipse(eggX,eggY,40,40);
    eggX+=eggVX; eggY+=eggVY; flying--;
  }
}
void mousePressed(){
  eggX=400; eggY=280; flying=30;
  eggVX=(mouseX-eggX/30);
  eggVY=(mouseY-eggY/30);
}