Arduino d [#i181010c] EditToHeaderToFooter

センサー EditToHeaderToFooter

圧力センサー EditToHeaderToFooter

FSR-402 EditToHeaderToFooter

  • soft
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
    
    const int iSensor = 1;
     
    void fSendInt1024(int a);
     
    void setup() {
      Serial.begin(9600);
    }
    void loop() {
      int vSensor = 0; // in int[0:.1024]
      vSensor = analogRead(iSensor);
      fSendInt1024(vSensor);
      delay(500);
    }
     
    void fSendInt1024(int a) {
      char vData[6];
      vData[3] = '0' + a % 10;  a /= 10;
      vData[2] = '0' + a % 10;  a /= 10;
      vData[1] = '0' + a % 10;  a /= 10;
      vData[0] = '0' + a % 10;
      vData[4] = '\n';
      vData[5] = '\0';
      Serial.write(vData);
    }

光センサー(硫化カドミウム CdS セル) EditToHeaderToFooter

コンパレータ EditToHeaderToFooter

2u/chipLM393N\25/1chip\12.5/unit
4u/chipLM339\30/1chip\ 7.5/unit
2u/chipNJM2903D\100/5chip\10.0/unit
4u/chipNJM2901N\50/1chip\12.5/unit

6.7kΩ EditToHeaderToFooter

温度センサー(1wire-digital) EditToHeaderToFooter

Hard EditToHeaderToFooter

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
int n = 0
DS18B20 sensor[0:.n]
Arduino arduino;
 
pin vcc = arduino.vcc
pin gnd = arduino.gnd
pin data = vcc -- R4.7kΩ
 
sensor[0:.n].gnd = gnd
sensor[0:.n].dq  = data
sensor[0:.n].vdd = gnd // parasite power
 

Soft EditToHeaderToFooter

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
#include <OneWire.h>
#include <DallasTemperature.h>
 
OneWire oneWire(2);
DallasTemperature sensor(&oneWire);
 
#define N 2
 
void setup() {
  Serial.begin(9600);
  Serial.println("Begin OneWireTemprature");
  sensor.begin();
  delay(100);
  
  Serial.print("  sensor.getDeviceCount ==> ");
  Serial.println(sensor.getDeviceCount());
  delay(100);
}
 
 
void loop() {
  sensor.requestTemperatures();
  Serial.print("  T ==> [");
  Serial.print(sensor.getTempCByIndex(0));
  for(int i = 1; i < N; i++) {
    Serial.print(", ");
    Serial.print(sensor.getTempCByIndex(i));
  }
  Serial.println("]");
  delay(100);
}
    技術 一覧 検索 最新 バックアップ リンク元   ヘルプ   最終更新のRSS