Coder Social home page Coder Social logo

fgenesis / hwmf Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 0.0 307 KB

Demo for Arduino Mega (ATmega2560) and an LCD. Got 2nd place at Revision 2020 wild compo.

Home Page: https://www.pouet.net/prod.php?which=85292

C++ 94.77% C 5.23%
avr atmel demoscene atmega2560 mipi

hwmf's Introduction


(Click for youtube)

PARTY VERSION!

Credits where credits are due:

The following 3rd party resources were used:

How to compile the thing

The easiest way is to get Arduino IDE. See https://www.arduino.cc/en/Main/Software

Load democode.ino in the Arduino IDE, compile it, flash it, done. Possibly read the comments in democode.ino in case the compiler is too old or does not like the code and refuses to compile it.

Settings:

Board: "Arduino/Genuino Mega or Mega 2560" Processor: ATmega2560 (5V 16 MHz if that's a choice)

Note that the code in the source archive is the party version; it's horrible and hacky and fixed to work just before the deadline, and it's likely i'll clean it up a bit later.

See https://github.com/fgenesis/hwmf for up-to-date code.

Getting audio out

Audio is output to OCR0A (Pin #13) and OCR0B (Pin #4). This demo has mono audio so either one works. Stereo is a future possibility so in case you're building an add-on board you might plan ahead for that.

Connect it like this:

Pin 4  o-----||-----> left audio channel
Pin 13 o-----||-----> right audio channel
Any GND pin directly to the audio GND.

As insulating capacitors ||, 1.0 µF works fine. Something close to that probably too. Don't connect the pins directly to the audio, they are at 0-5V level (instead of approx. -1..+1V that analog audio usually has) and the receiving device might be unhappy about that (magic smoke worst case). The caps make this a lot safer, and it also sounds much better as they center the signal around GND.

The on-board LED is also connected to Pin #13 so if you see it pulse a little after a few seconds after reset, that's an indication it's playing audio correctly.

Changing the display controller

The binaries in this release archive are compiled for the ILI9481 display controller. There is (untested) support for ILI9486 and HX8357C as well, so if you have those, go to democode/src/demolib/cfg-demo.h, look for this:

typedef fglcd::preset::ILI9481_Mega_Shield LCD;

and change it to

typedef fglcd::preset::ILI9486_Mega_Shield LCD;

-or-

typedef fglcd::preset::HX8357C_Mega_Shield LCD;

In case your display controller is 480x320 but none of the above, feel free to contact me and I might add support for your controller. Alternatively create a new type describing the controller and add the init code required to start up the display. In case you do this, please send me a pull request so the display library can support more controllers!

Those MIPI displays are pretty compatible so it should work just fine after it's set up properly with the correct initcode.

-- fgenesis, for Revision 2020

hwmf's People

Contributors

fgenesis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hwmf's Issues

Don't work with ILI9486 display

Hello.
I have a ILI9486 display, and I made the change mentioned in the readme.md, but the display don't shows anyting.

Regards.
Jose.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.