LoginSignup
0

More than 5 years have passed since last update.

lazuriteでanalogread

Posted at

概要

lazuriteでanalogreadやってみた。

写真

CIMG2670.JPG

回路図

image

サンプルコード

void setup()
{
    Serial.begin(115200);
    analogReadResolution(12);
    hsv.init(1, 20000);
    hsv.attach(0, 5);
    hsv.write(0, 800);
    hsv.start();
    Serial.println("start");
}
void loop()
{
    volatile int val = analogRead(A2);
    int range;
    range = map(val, 0, 4095, 500, 2400);
    Serial.println_long(range, DEC);
    hsv.write(0, range);
    hsv.update();
    delay(500);
}

以上。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0