element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Code Exchange
  • Technologies
  • More
Code Exchange
Documents It's working! chipKIT Max32 with added IO Sheild
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Code Exchange to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: patkelly
  • Date Created: 6 Dec 2012 9:36 AM Date Created
  • Last Updated Last Updated: 8 Oct 2021 5:18 AM
  • Views 597 views
  • Likes 2 likes
  • Comments 1 comment
Related
Recommended

It's working! chipKIT Max32 with added IO Sheild

After much head scratching and lot of google'ing I finally got the OLED screen on the chipKIT IO Shield to turn on. Here's the proof:

 

image

 

Please join me in the most triumphant achievement. I think I deserve a cuppa and a biscuit(if I can find some).

 

Here is the code that I used to get the OI shield to display, it's a mashup of the demo script and the usual Arduino button script. So if you switch the sliding switch at pin 2 on, the OLED screen turns on, switch it again it goes off.

 

A few prerequisites, when you download the OLED demo from the Max32 website the example code is in a different folder to the files required so make sure you copy all these over to the same directory (it's one those silly little things that gets you scratching your head, for ages going "but it's right, just work"):

 

  • ChrFont0.c
  • delay.c
  • delay.h
  • FillPat.c
  • IOSheildOled.cpp
  • IOShieldOled.h
  • OledChar.c
  • OledChar.h
  • OLedDriver.c
  • OledDriver.h
  • OledGrph.c
  • OledGrph.h

 

 

<-------Code Start--------->

 

#include <IOShieldOled.h>

 

const int buttonPin = 2;

int buttonState = 0;  

 

void setup()

{

  IOShieldOled.begin();

  pinMode(buttonPin, INPUT);

}

 

void loop()

{

  int irow;

  int ib;

 

  //Clear the virtual buffer

  IOShieldOled.clearBuffer();

 

  //Chosing Fill pattern 0

  IOShieldOled.setFillPattern(IOShieldOled.getStdPattern(0));

  //Turn automatic updating off

  IOShieldOled.setCharUpdate(0);

 

  buttonState = digitalRead(buttonPin);

 

  // check if the pushbutton is pressed.

  // if it is, the buttonState is HIGH:

  if (buttonState == HIGH) {    

    // turn LED on:   

    IOShieldOled.displayOn();

  }

  else {

    // turn LED off:

    IOShieldOled.displayOff();

  }

 

  for (irow = 0; irow < IOShieldOled.rowMax; irow++)

  {

    IOShieldOled.clearBuffer();

    IOShieldOled.setCursor(0, 0);

    IOShieldOled.putString("element14.com");

    IOShieldOled.setCursor(0, 1);

    IOShieldOled.putString("Community");

    IOShieldOled.setCursor(0, 2);

    IOShieldOled.putString("by PK");

    IOShieldOled.setCursor(0, 3);

    IOShieldOled.putString("Not bad eh!");

    IOShieldOled.updateDisplay();

    delay(100);

  }

  delay(100);

}

<------------Code End--------------->    

Hopefully, I'll post a more in depth review on this great piece of kit in the next few 'bits' of time.

 

All the best

 

Pat

  • code_exchange
  • Code Exchange
  • codeexchange
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply
  • Former Member
    Former Member over 11 years ago

    Hello PatKelly,

     

    I want to use the header files that you have used in this document, but when I went to the site to download them, I could not find them due to a 404. Is it possible for you to post the header files or give me the new address where I can find them in order to download them.

     

    Thanks

    Xerxes

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube