Quantcast
Channel: Reprap Forum - Controllers
Viewing all articles
Browse latest Browse all 10211

Using the full graphic smart controller outside of 3d printing, without the RAMPS board

$
0
0
I'd like to find out the correct pins to use for the u8g library, so that I can use my display, buzzer and encoder in other Arduino Sketches....

I understand the programming aspect, but I'm really strugeling to know:

"Which of my pins are (sck, mosi, cs [, reset]) or more specifically, (E, RW, RS, RST)?

I've been looking through the Marlin firmware to try and find where the pins get assigned, but with so far no luck because I'm pretty new to Arduino.

I'm hoping someone can simply tell me......

Your constructor should look like: "U8GLIB_ST7920_128X64_1X u8g(17, 23, 50, 16);"

Or whatever the numbers should be for my setup...

My current setup is working with the Marlin firmware, but with the Ramps board removed....
I'm currently pluged into:
  • TX2 16
  • RX2 17
  • Digital 23
  • 5v
  • Ground
And I have my Buzzer and Encoder Click in Digital 35 & 37

But what each line to 16, 17 and 23 is I dont know.... More confusingly, I tried them in all arrangements in my constructor declaration, but I'm still not getting a Hello World...

My code is included, just in case someone spots a bug...

#include "U8glib.h"
#include 

//Pins to try:
  //16, 17, 23
  //U8GLIB_DOGM128(cs, a0 [, reset])
//U8GLIB_NHD27OLED_2X_BW u8g(16, 17, 23);
U8GLIB_ST7920_128X64_1X u8g(17, 23, 16);

void setup()
{
}

void loop()
{
  // picture loop
  u8g.firstPage();  
  do {
    draw();
  } while( u8g.nextPage() );
  
  // rebuild the picture after some delay
  delay(1000);
}

void draw(void) {
  // graphic commands to redraw the complete screen should be placed here  
  u8g.setFont(u8g_font_unifont);
  u8g.drawStr( 0, 20, "Hello World!");
}

Viewing all articles
Browse latest Browse all 10211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>