Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SPI.h>
- #include <Wire.h>
- #include <Adafruit_GFX.h>
- #include <Adafruit_SSD1306.h>
- #define OLED_RESET 4
- Adafruit_SSD1306 display(OLED_RESET);
- int potValue=0;
- int potValue1=0;
- int online = 0;
- float systemdruck = 0.00;
- int zz = 0;
- int xx = 10;
- int x0;
- int y0;
- void setup()
- {
- Serial.begin(9600);
- display.begin(SSD1306_SWITCHCAPVCC);
- display.setTextColor(WHITE);
- display.clearDisplay();
- }
- void loop()
- {
- potValue = analogRead(A0);
- //xy Achsen
- display.drawLine(0, 0, 0, 31, WHITE);
- display.drawLine(0, 31, 127, 31, WHITE);
- potValue1 = map(potValue, 0, 1023, 0, 31); // analog Eingang auslesen und auf LCDhöhe angepasst
- //Kurve zeichnen
- display.drawPixel(x0, potValue1, WHITE);
- if (x0 <127)
- {
- x0++;
- }
- if ( x0 == 127)
- {
- x0=127;
- }
- display.display();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement