Demo entry 6359812

ArduinoOscilliscope

   

Submitted by anonymous on Apr 29, 2017 at 21:12
Language: Arduino. Code size: 621 Bytes.

//OScopeTest.ino

#include <SoftwareSerial.h>
SoftwareSerial mySerial(3,2);


int led = 13;
int read_pin = 0;
int val = 0;

void setup() {
mySerial.begin(9600);
delay(500);
mySerial.write(254);
mySerial.write(VOLTAGE:        );
mySerial.write(128);
mySerial.write(RAW:            );
  Serial.begin(9600);
  pinMode(led, OUTPUT);
  pinMode(read_pin, INPUT);
}

void loop() {
    val = analogRead(read_pin);
mySerial.write(128)
mySerial.write(RAW: %4i       , val)
    val = map(val, 0, 5, 0, 1023);
mySerial.write(254)
mySerial.write(VOLTAGE: %4i   , val)
    Serial.println(val);
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).