anonymous arduino nano every で簡単なプログラム
No License C
2020年11月14日
Copy
const int LED_PIN = 13;         /* LED DIO                     */
const int RIG_BAND_PIN = A0;    /* BAND pin 入力               */

void setup()
{
    Serial.begin(115200);
    pinMode( LED_PIN, OUTPUT);
}

void loop()
{
    int   voltage_lsb;
    float voltage;

    voltage_lsb = analogRead( RIG_BAND_PIN);
    voltage = voltage_lsb / 1023.0;
    
    Serial.print( "LSB:");
    Serial.print( voltage_lsb);
    Serial.print( " Voltage:");
    Serial.println( voltage);
    if( voltage_lsb > 512){
        digitalWrite( LED_PIN, HIGH);
    }else{
        digitalWrite( LED_PIN, LOW);
    }
    delay(1000);
}
const int LED_PIN = 13;         /* LED DIO                     */
const int RIG_BAND_PIN = A0;    /* BAND pin 入力               */

void setup()
{
    Serial.begin(115200);
    pinMode( LED_PIN, OUTPUT);
}

void loop()
{
    int   voltage_lsb;
    float voltage;

    voltage_lsb = analogRead( RIG_BAND_PIN);
    voltage = voltage_lsb / 1023.0;
    
    Serial.print( "LSB:");
    Serial.print( voltage_lsb);
    Serial.print( " Voltage:");
    Serial.println( voltage);
    if( voltage_lsb > 512){
        digitalWrite( LED_PIN, HIGH);
    }else{
        digitalWrite( LED_PIN, LOW);
    }
    delay(1000);
}

年末年始は機械学習・深層学習を勉強しませんか?
No one still commented. Please first comment.
年末年始は機械学習・深層学習を勉強しませんか?
広告
未経験から最短でエンジニアへの転職を目指すなら