Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Shahariar
Published © Apache-2.0

Animated E-Paper Badge

An animated e-paper display badge for Hacksters.

BeginnerFull instructions provided2 hours3,475

Things used in this project

Hardware components

XMC2GO - industrial microcontroller kit
Infineon XMC2GO - industrial microcontroller kit
×1
E Paper Display
×1
SparkFun LiPo Battery 110 mAh
×1
2cm x 8cm Proto Board
×2
SparkFun 1N4148 Diode
×2

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

pinout

pin mapping between xmc2go and e-paper display

wiring

wiring for xmc1100 mcu, e-paper display

Code

Animated EPD Badge

C/C++
main c
#include <SPI.h>
#include "epd1in54.h"
#include "epdif.h"
#include "epdpaint.h"
#include "imagedata.h"



int COLORED  = 0; // White in Black
int UNCOLORED = 1;  // Black in White

unsigned char image[8192];   // takes 5k-8k RAM  
//////////////////////////////////////////////////
// width must be multiple of 8
Paint paint(image, 0, 0);     
Epd epd;                     
//////////////////////////////////////////////////////

void setup() 
{
    flush_epd();  
///// Init Full Display Update ///////////
  if (epd.Init(lut_full_update) != 0) 
  {return;}  
///// Init Partial Display Update ////////
  if (epd.Init(lut_partial_update) != 0) 
  {return;}
////////// Clears Up Full Disp ///////////
// bit set = white, bit reset = black
  epd.ClearFrameMemory(0xFF);   
  epd.DisplayFrame();
  epd.ClearFrameMemory(0xFF);   
  epd.DisplayFrame();

}



void loop() 
{

 ////////////// Static Image /////////////////////////////////////////      
  epd.SetFrameMemory(IMAGE_DATA1);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA2);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA3);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA4);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA5);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA6);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA7);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA8);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA9);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA10);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA12);
  epd.DisplayFrame();
    /*
  epd.SetFrameMemory(IMAGE_DATA13);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA14);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA15);
  epd.DisplayFrame();
  epd.SetFrameMemory(IMAGE_DATA16);
  epd.DisplayFrame();
*/
// delay(1000);
// flush_epd();
 
} // loop ends here //


// clean up dark spots on epaper display
void flush_epd (void)
{
  if (epd.Init(lut_full_update) != 0) 
  {return;}
  epd.ClearFrameMemory(0xFF);   
  epd.DisplayFrame();
  epd.ClearFrameMemory(0xFF);   
  epd.DisplayFrame();
  
}

Full Code

C/C++
IDE ver 1.8.15.0
XMC Board ver 1.1.0
No preview (download only).

ADC, PWM, Sleep, RTC, RAM test code

C/C++
Optional code for ADC, PWM, RTC, Sleep etc for development purpose
No preview (download only).

Mario melody play on buzzer

C/C++
https://www.hackster.io/jrance/super-mario-theme-song-w-piezo-buzzer-and-arduino-1cc2e4
No preview (download only).

Hackster Logo and Animation

C/C++
No preview (download only).

IO Test

C/C++
PWM ADC SLEEP I2C UART GPIO Numericals
No preview (download only).

Credits

Shahariar

Shahariar

74 projects • 266 followers
"What Kills a 'Great life' is a 'Good Life', which is Living a Life Inside While Loop"

Comments