<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 牛人業(yè)話(huà) > 伽利略開(kāi)發(fā)板和BeeMail(三):對象

伽利略開(kāi)發(fā)板和BeeMail(三):對象

作者:EEPW編譯 時(shí)間:2014-11-25 來(lái)源:電子產(chǎn)品世界 收藏

  原型擴展板有利于UNO用于初步檢驗和板的轉移,從UNO的轉移可以確定,板的I/O引腳在嵌入式啟動(dòng)和Arduino草圖啟動(dòng)期間處于上拉狀態(tài)(取決于5V還是3.3V電壓)。

本文引用地址:http://dyxdggzs.com/article/265933.htm

  上面所說(shuō)只是在理想狀態(tài)下的負邏輯,但馬達系統其實(shí)并不太適用。這里我按照GPIO的思路將引腳初始化為高電平,看看能不能找出其他辦法。

  代碼部分

  以下代碼僅為對蜜蜂基于電位計作為輸入的測試。若對蜜蜂不加干涉,程序自動(dòng)上鎖,我在這里遇到了麻煩。我去檢查串聯(lián)端口和端口是否正常,可直到現在我仍舊不清楚到底是哪里出了問(wèn)題。

  //------------------------------------------------------------ START LICENSE

  /*The MIT License (MIT)

  Copyright (c) 2014 Carlyn Maw

  特此授權許可,在此情況下本軟件免費,并允許任何人復制此軟件及相關(guān)文檔,不限制銷(xiāo)售,任何人有權使用、復制、修改、合并、出版、發(fā)行、授予執照或銷(xiāo)售軟件副本,供任何對其有幫助的使用者使用。

  以上版權聲明和許可聲明包括軟件所有副本和可觀(guān)部分。

  軟件未加任何明指或暗指的擔保,按現狀出售,但不限于為特定目的和不侵權的適銷(xiāo)性及適用性的擔保。

  在任何情況下,作者或版權持有人,都無(wú)權要求任何索賠或有關(guān)損害賠償的其他責任,不管在本軟件的使用上或其他買(mǎi)賣(mài)交易中是否涉及合同、侵權或其他行為。

  */

  // ---------------------------------------------------------------- END LICENSE

  //This code is testing code for the circut to make sure all of the

  //physical Arduino I/O is working. It checks a potentiometer or other

  //sensors on the AO PIN and equates it to the future number of mails

  //in the inbox.

  //On each pin 9, 10 and 11 are 220 Ohm resistors leading to the bases of

  //PN2222A transistors. The collector is attached to the motor and the

  //emitter to ground.

  //------------------------------------------------- OUTPUTS AND THEIR VARIABLES

  //the total number of bees bing controlled

  const int beeTotalNumber = 3;

  int beePins[beeTotalNumber] = {9, 10, 11 };

  //INPUTS AND THEIR VARIABLES

  int howManyNewEmails = 0;

  //-------------------------------------------------------- GLOBAL BEE SETTINGS

  //the number of emails the bees hit maximum freakout.

  //ideally it should be divisible by the number of

  //beeActivityLevels

  int maxBeeVar = 1023;

  //how many different states the Bees can be in

  const int beeActivityLevels = 16;

  //The area that dictates the 16 BeeActivityLevels.

  int b[beeActivityLevels][beeTotalNumber] =

  {

  { 0, 0, 0 },

  { 0, 0, 50 },

  { 0, 50, 50 },

  { 50, 50, 50 },

  { 50, 50, 100 },

  { 50, 100, 100 },

  { 100, 100, 100 },

  { 100, 100, 150 },

  { 100, 150, 150 },

  { 150, 150, 150 },

  { 150, 150, 200 },

  { 150, 200, 200 },

  { 200, 200, 200 },

  { 200, 200, 250 },

  { 200, 250, 250 },

  { 255, 255, 255 },

  };

  //---------------------------------------------------------------------- SETUP

  void setup() {

  Serial.begin(9600);

  }

  //----------------------------------------------------------------------- LOOP

  void loop() {

  //get the data determining bee behavior

  howManyNewEmails = analogRead(A0);

  //Serial.println(howManyNewEmails);

  //update the bees

  updateBees(howManyNewEmails, maxBeeVar);

  //mini-pause

  delay(10);

  }

  //---------------------------------------------------------------- updateBees()

  void updateBees(int v, int maxVal) {

  //ignore any values of V above maximum freakout level

  // v = min(v, maxVal); does not work in Intel Galileo MacOS IDE

  if (v > maxVal) {

  v = maxVal;

  }

  //map the newly constrained V to the beeActivityLevel array

  //the top value is 1 less than the number than the array size

  //because the an array starts with the index number 0

  int mappedV = map(v, 0, maxVal, 0, beeActivityLevels-1);

  //Serial.println(mappedV);

  //for each bee, get the value it supposed to be and set it there

  for (int i=0; i <= beeTotalNumber-1; i++){

  //Serial.println(b[mappedV][i]);

  analogWrite(beePins[i], b[mappedV][i]);

  }

  }

電容器相關(guān)文章:電容器原理



上一頁(yè) 1 2 下一頁(yè)

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>