Project #6: MicroView – Mk05
MicroView
Project #6 – Mk05
4 x LED
1 x MicroView
1 x MicroView – USB Programmer
1 X Resistor 620 Ohm
1 X Resistor 5 Ohm
1 X Resistor 250 Ohm
1 X Resistor 200 Ohm
1 X 3mm Low Current Red LED – WP710A10LSRD
1 x 3mm Low Current Yellow LED – WP710A10LYD
1 x 3mm Low Current Green LED – WP710A10LGD
1 x 3mm Low Current Red LED – WP710A10LID
9 x Jumper Wires 3″ M/M
1 x Half-Size Breadboard
08 pin – GND
14 pin – 6
13 pin – 5
12 pin – 3
11 pin – 2
DonLuc1804Mk09a.ino
// ***** Don Luc ***** // Software Version Information // 5.01 // DonLuc1804Mk06 5.01 // MicroView // 4 x LED // include the library code: #include <MicroView.h> // 4 x LED int ledPinR = 2; // select the pin for the LED Red - WP710A10LSRD int ledPinY = 3; // select the pin for the LED Yellow - WP710A10LYD int ledPinG = 5; // select the pin for the LED Green - WP710A10LGD int ledPinR1 = 6; // select the pin for the LED Red - WP710A10LID void loop() { // 4 x LED isLED(); uView.clear(PAGE); }
getLED.ino
void isLED(){ digitalWrite(ledPinR, HIGH); // turn the ledPinR on digitalWrite(ledPinY, HIGH); // turn the ledPinY on digitalWrite(ledPinG, HIGH); // turn the ledPinG on digitalWrite(ledPinR1, HIGH); // turn the ledPinR1 on uView.setFontType(1); // set font type 1: Numbers and letters. 7 characters per line (3 lines) uView.setCursor(0,20); uView.print( " On" ); uView.display(); delay(5000); uView.clear(PAGE); digitalWrite(ledPinR, LOW); // turn the ledPinR off digitalWrite(ledPinY, LOW); // turn the ledPinY off digitalWrite(ledPinG, LOW); // turn the ledPinG off digitalWrite(ledPinR1, LOW); // turn the ledPinR1 off uView.setCursor(0,20); uView.print( " Off" ); uView.display(); delay(5000); uView.clear(PAGE); digitalWrite(ledPinR, HIGH); // turn the ledPinR on uView.setFontType(0); // set font type 0: Numbers and letters. 10 characters per line (6 lines) uView.setCursor(0,20); uView.print( "PinR=On" ); uView.display(); delay(3000); uView.clear(PAGE); digitalWrite(ledPinR, LOW); // turn the ledPinR off digitalWrite(ledPinY, HIGH); // turn the ledPinY on uView.setCursor(0,10); uView.print( "PinR=Off" ); uView.display(); uView.setCursor(0,30); uView.print( "PinY=On" ); uView.display(); delay(3000); uView.clear(PAGE); digitalWrite(ledPinY, LOW); // turn the ledPinY off digitalWrite(ledPinG, HIGH); // turn the ledPinG on uView.setCursor(0,10); uView.print( "PinY=Off" ); uView.display(); uView.setCursor(0,30); uView.print( "PinG=On" ); uView.display(); delay(3000); uView.clear(PAGE); digitalWrite(ledPinG, LOW); // turn the ledPinG off digitalWrite(ledPinR1, HIGH); // turn the ledPinR1 on uView.setCursor(0,10); uView.print( "PinG=Off" ); uView.display(); uView.setCursor(0,30); uView.print( "PinR1=On" ); uView.display(); delay(3000); uView.clear(PAGE); digitalWrite(ledPinR, LOW); // turn the ledPinR off digitalWrite(ledPinY, LOW); // turn the ledPinY off digitalWrite(ledPinG, LOW); // turn the ledPinG off digitalWrite(ledPinR1, LOW); // turn the ledPinR1 off uView.setFontType(1); // set font type 1: Numbers and letters. 7 characters per line (3 lines) uView.setCursor(0,20); uView.print( "Off" ); uView.display(); delay(3000); uView.clear(PAGE); }
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); // set font type 1: Numbers and letters. 7 characters per line (3 lines) 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(1); // set font type 1: Numbers and letters. 7 characters per line (3 lines) uView.setCursor(0,20); uView.print("4 x LED"); uView.display(); delay(5000); uView.clear(PAGE); // ledPinR, ledPinY, ledPinG, ledPinR1 pinMode(ledPinR, OUTPUT); pinMode(ledPinY, OUTPUT); pinMode(ledPinG, OUTPUT); pinMode(ledPinR1, OUTPUT); }
Don Luc
Leave a Reply