element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Vision Thing
  • Challenges & Projects
  • Project14
  • Vision Thing
  • More
  • Cancel
Vision Thing
Blog LDR Camera #3 : Trying to make a Grey Scale LED matrix Display
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Vision Thing to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dubbie
  • Date Created: 28 Sep 2019 4:55 PM Date Created
  • Views 1072 views
  • Likes 8 likes
  • Comments 3 comments
  • visionthingch
  • ard_expert
  • 8x8 led matrix
  • ai project
  • ldr camera
Related
Recommended

LDR Camera #3 : Trying to make a Grey Scale LED matrix Display

dubbie
dubbie
28 Sep 2019
image

Vision Thing

Enter Your Project for a chance to win an Oscilloscope Grand Prize Package for the Most Creative Vision Thing Project!

Back to The Project14 homepage image

Project14 Home
Monthly Themes
Monthly Theme Poll

 

Following on from getting the 1x8 LDR array to display on the 8x8 LED matrix display with just two levels (ON and OFF) I tried implementing my idea of multiplexing the whole display in software to create a sort of PWM effect that might mimic grey scale display. The GFX library contains a function to display a bit mapped image on the display and this seemed the most likely method of updating the whole display quickly. So I created four arrays of bit mapped images as shown below.

 

static const uint8_t PROGMEM // Bitmaps are stored in program memory

greyimg1[8] =

  { B11111111,    

    B11111111,

    B11111111,

    B11111111,

    B11101111,

    B11111111,

    B11111111,

    B11111111 };

static const uint8_t PROGMEM

greyimg2[8] =   

  { B11111100,    

    B11111100,

    B11111100,

    B11111100,

    B11101100,

    B11111100,

    B11111100,

    B11111100 };

static const uint8_t PROGMEM

greyimg3[8] =  

  { B11110000,    

    B11110000,

    B11110000,

    B11110000,

    B11100000,

    B11110000,

    B11110000,

    B11110000 };

static const uint8_t PROGMEM   

greyimg4[8] = 

  { B11000000,    

    B11000000,

    B11000000,

    B11000000,

    B11000000,

    B11000000,

    B11000000,

    B11000000 };

 

Then I used a while loop to sequence through each of the four bit mapped images.

 

while (1)

  {

    matrix.clear();

    matrix.drawBitmap(0, 0, greyimg1, 8, 8, LED_ON);

    matrix.writeDisplay();  // write to display

//    delay(1000);

    matrix.clear();

    matrix.drawBitmap(0, 0, greyimg2, 8, 8, LED_ON);

    matrix.writeDisplay();  // write to display

//    delay(1000);  

    matrix.clear();

    matrix.drawBitmap(0, 0, greyimg3, 8, 8, LED_ON);

    matrix.writeDisplay();  // write to display

//    delay(1000);   

    matrix.clear();

    matrix.drawBitmap(0, 0, greyimg4, 8, 8, LED_ON);

    matrix.writeDisplay();  // write to display    

//    delay(1000);   

  } /* while */

 

These were then output to the LED display one after another, see the video below. This is stepping through the four images slowly so that I could check that it was cycling properly.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

This looked like it might work so I removed the software delay between the different bit mapped images and obtained the result shown below.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

This is a time-multiplexed image so the video cannot really keep up with it and it looks a bit weird, but essentially what seems to be happening is that the multiplexing implemented by the HT16K33 controller is slower than needed and seems to take longer than the time taken between bit mapped images. The result is just a lot of visible flickering rather than grey levels of LED brightness. Ah well, it was worth a try. Now I know more about how the LED matrix display works. Even if it had worked I'm not sure I could have used it as the matrix.drawBitmap() function requires the image to be in programme memory rather than the normal RAM area used for variables.

 

It is not too important that this doesn't work as this display is just for information anyway so that I can check everything is working. I will still be able to feed grey scale images into the ANN to classify images.

 

Dubbie

  • Sign in to reply

Top Comments

  • dubbie
    dubbie over 5 years ago in reply to clem57 +2
    I left the centre LED off intentionally to be sure I was displaying the bit-mapped image. It took me ages to work out how to get different images to display. You seem to have to clear the image before…
  • clem57
    clem57 over 5 years ago +1
    I like the effect... So you now know the limits of the 8 X 8. BTW, the center light may be out in the first video. great job dubbie
  • dubbie
    dubbie over 5 years ago in reply to clem57

    I left the centre LED off intentionally to be sure I was displaying the bit-mapped image. It took me ages to work out how to get different images to display. You seem to have to clear the image before writing the new image, which doesn't seem all that necessary but I guess it must be some characteristic of the HI16K33 controller.

     

    Dubbie

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jw0752
    jw0752 over 5 years ago

    The first steps are always to get a feel for and learn the limitations of the hardware that is available. Good progress.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 5 years ago

    I like the effect... So you now know the limits of the 8 X 8. BTW, the center light may be out in the first video. great job dubbie

    • Cancel
    • Vote Up +1 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