The Alpha Geek – Geeking Out

Project #6: MicroView – Mk04

MicroView
Project #6 – Mk04

Trimpot – LED

1 x MicroView
1 x MicroView – USB Programmer
1 X Trimpot 10K with Knob
1 X Resistor 2.55k Ohm
1 X 3MM Low Current Red LED
6 x Jumper Wires 3″ M/M
1 x Half-Size Breadboard

05 pin – A2
08 pin – GND
11 pin – 2
15 pin – +5V

DonLuc1804Mk06d.ino

// ***** Don Luc *****
// Software Version Information
// 3.01
// DonLuc1804Mk06 4.04
// MicroView
// Trimpot - LED

// include the library code:
#include <MicroView.h>

// Potentiometer
int potPin = A2;    // select the input pin for the potentiometer
int ledPin = 2;   // select the pin for the LED
int potPot = 0;
String cap = "";

void loop() {

  // Potentiometer
  isCap();

  delay(500);
  uView.clear(PAGE);
  
}

getPot.ino

void isCap(){

    potPot = analogRead(potPin);    // read the value from the sensor
    cap = "Pot: ";
    cap.concat(potPot);
    
    uView.setFontType(0);
    uView.setCursor(0,20);
    uView.print( cap );
    uView.display();
    
}

setup.ino

void setup() {

  uView.begin();       // begin of MicroView
  uView.clear(ALL);    // erase hardware memory inside the OLED controller
  uView.display();     // display the content in the buffer memory, by default it is the MicroView logo
  delay(1000);
  uView.clear(PAGE);   // erase the memory buffer, when next uView.display() is called, the OLED will be cleared.

  uView.setFontType(1);
  uView.setCursor(0,20);
  uView.print("Don Luc");
  uView.display();
  delay(5000);

  uView.clear(PAGE);   // erase the memory buffer, when next uView.display() is called, the OLED will be cleared.

  uView.setFontType(0);
  uView.setCursor(0,20);
  uView.print("TrimpotLED");
  uView.display();
  delay(5000);
  
  uView.clear(PAGE);

  // ledPin
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);  // turn the ledPin on

}

Don Luc

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories
Archives