Home › Forums › Game Frame › Technical Support › pixel order question for DIY gameframe
- This topic has 11 replies, 3 voices, and was last updated 8 years, 7 months ago by avs.stolyarov.
-
AuthorPosts
-
December 4, 2015 at 7:36 pm #2088aromanoParticipant
Hi,
I am building my own game frame. I am getting read to solder up my display and I am wondering where you have the led chain start…if you are looking at the front of the gameframe is LED 0 at the Top Left , Top Right, Bottom left or bottom right? I dont want my text and things to end up being backwards or upside down.
Thanks Alot !
December 4, 2015 at 8:32 pm #2089Jeremy WilliamsKeymasterI’m on the road at the moment but as I recall it starts at the upper right. In any case, as long as you start at an upper corner it’s an easy code change to swap between them.
December 5, 2015 at 2:59 am #2090aromanoParticipantok… I just didn’t want to do all this soldering and find out all my images are backwards lol but so far I got everything loaded on to my Arduino and talking with the sd card along with the ini files… I think it will be smooth sailing for me.. thanks for developing and providing all the source code !
December 17, 2015 at 6:19 pm #2100aromanoParticipantso my images are backwards and I can’t seem to find a line of code to mirror the image… can you help me out?
December 17, 2015 at 6:51 pm #2102Jeremy WilliamsKeymasterYeah, you want to edit the getIndex function. Let me know if you need more help.
December 17, 2015 at 8:36 pm #2103aromanoParticipantI was able to apply the code that I found on here from another guy doing a DIY build … It’s all working great!
BTW Thanks a ton for selling the game frame SD contents … I just got it with Paypal ! I mean, you basically gave us everything else for free might as well pay for something right ? lol
…I’m hoping to sneak some more code into it so I can use one of those cheap o arduino IR remote in addition to the two buttons … Do you think there will be enough memory ?
December 18, 2015 at 3:25 am #2104Jeremy WilliamsKeymasterProbably not enough memory for IR code unless you switch to a fatter microcontroller like the Teensy. More importantly, IR doesn’t get along well with these particular LEDs (WS2812). IR libraries employ pin interrupts to receive remote signals. Unfortunately, to meet the LED timing requirements, the Arduino suspends its interrupts while light data is being sent.
December 18, 2015 at 5:13 am #2105aromanoParticipanthmm plan b…
I guess I’m just going to have to use another Arduino just for IR that can control a npn on the button circuit so I have a remote lol and if digitalread won’t work right with a transistor lol I can just use mechanical relays lol at least they will sound cool … second thought, mechanical relays for the cool factor lol
December 18, 2015 at 6:49 am #2106Jeremy WilliamsKeymasterYou can use another Arduino to handle the IR, but I’d suggest sending data to the main Arduino using the HardwareSerial library. Serial has a small buffer that can store input data even while interrupts are disabled. I’ve done this on a prototype and it works well.
December 18, 2015 at 2:14 pm #2107aromanoParticipantThanks good to know… I will do that … It’s nice to get advice from someone who knows much more about programming that I do lol
December 18, 2015 at 4:06 pm #2108Jeremy WilliamsKeymasterCome to think of it, I was using Teensy for that prototype. I can’t find any information on whether Arduino Uno (ATMEGA328) serial input is buffered when interrupts are disabled, so good luck and let me know how it goes.
April 3, 2016 at 8:07 am #2527avs.stolyarovParticipantTry to change the getIndex routine like this (TOP-LEFT, ZIG-ZAG):
byte getIndex(byte x, byte y) { byte index; if (y % 2 == 1){ int rawIndex = (x + (y * 16)); int begin = y * 16; int end = (y * 16) + 15; index = end - (rawIndex - begin); } else{ index = x + (y * 16); } return index; }
-
AuthorPosts
- The forum ‘Technical Support’ is closed to new topics and replies.