Shop OBEX P1 Docs P2 Docs Learn Events
OLED initialization — Parallax Forums

OLED initialization

After using the OLED initialize Block, and then looking at code, there is always an extra number in the code, so far a "2".

For example: oledc_init(9, 8, 7, 6, ,5, 2);

a. What is the purpose of the "2" ?

Comments

  • Ken GraceyKen Gracey Posts: 7,386
    edited 2017-05-24 05:07
    I downloaded the updated Library and checked OLED.H which says the following:
    /**
     * @brief Initializes the OLED screen by setting up it's SPI and control pins.
     *
     * @param SID which pin is connected to the Serial Data In pin, marked "DIN".
     * 
     * @param SCLK which pin is connected to the Serial Clock pin, marked "CLK".
     *
     * @param CS which pin is connected to the Chip Select pin, marked "CS".
     *
     * @param RS which pin is connected to the Read Status pin, marked "D/C".
     *
     * @param RST which pin is connected to the Reset pin, marked "RST".
     *
     * @param screen_rotation Sets up the OLED screen and establishes its orientation. (0) means the pins are pointed upwards, 
     * (1) means the pins are pointed to the left, (2) means the pins are pointed down and
     * (3) means the pins are pointed to the right.
     */
    void oledc_init(char SID, char SCLK, char CS, char RS, char RST, char screen_rotation);
    
    


    Ken Gracey


    Modedit: code tags
  • Thank you Ken, just what I needed to know.
  • You're welcome. How are things going in Blockly, in general?
Sign In or Register to comment.