Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Displays / oled ssd1306 128x64 display buffer access on: July 16, 2012, 02:53:04 am
hey im looking for an easy way to access the display buffer array inside the library from adafruit
i need access to it as if it were a normal array or does anyone know how to access an array inside a library

help would be greatly appreciated
many thanks
~matt K
2  Using Arduino / Displays / Re: TV out display.screen WHAT IS IT ?? on: July 11, 2012, 02:57:06 pm
thats exactly it
there is not command i can find that specifically does bitmaps that are included
this is the commands in the tetris one
its slightly different in that its TV.screen
Code:
void setCell(char x, char y,char bx, char by, char c, char f) {
  int index = bx/8 + x/2 + by*W/8 + y*4*W/8;
  if (c) {
    if (x & 1) {
      TV.screen[index] &= 0b11110000;
      TV.screen[index] |= 0b00001110;
      index+=W/8;
      TV.screen[index] &= 0b11110000;
      TV.screen[index] |= 0b00001010;
      if (f) TV.screen[index] &= 0b11111011;
      index+=W/8;
      TV.screen[index] &= 0b11110000;
      TV.screen[index] |= 0b00001110;
      index+=W/8;
      TV.screen[index] &= 0b11110000;
    }


and this is in the asteroids
Code:
void overlaybitmap(uint8_t x, uint8_t y, const unsigned char * bmp,
   uint16_t i, uint8_t width, uint8_t lines) {

uint8_t temp, lshift, rshift, save, xtra;
uint16_t si = 0;

rshift = x&7;
lshift = 8-rshift;
if (width == 0) {
  width = pgm_read_byte((uint32_t)(bmp) + i);
  i++;
}
if (lines == 0) {
  lines = pgm_read_byte((uint32_t)(bmp) + i);
  i++;
}

if (width&7) {
  xtra = width&7;
  width = width/8;
  width++;
}
else {
  xtra = 8;
  width = width/8;
}

for (uint8_t l = 0; l < lines; l++) {
  si = ((y + l) % display.vres())*display.hres() + x/8;
  //si = (y + l)*display.hres + x/8;
  if (width == 1)
    temp = 0xff >> rshift + xtra;
  else
    temp = 0;
  save = display.screen[si];
  temp = pgm_read_byte((uint32_t)(bmp) + i++);
  display.screen[si++] |= temp >> rshift;
  for ( uint16_t b = i + width-1; i < b; i++) {
    if (si % display.hres() == 0) {
      // wrapped around to the left side
      si -= display.hres();
    }
    save = display.screen[si];
    display.screen[si] |= temp << lshift;
    temp = pgm_read_byte((uint32_t)(bmp) + i);
    display.screen[si++] |= temp >> rshift;
  }
  if (si % display.hres == 0) {
    // wrapped around to the left side
    si -= display.hres;
  }
  if (rshift + xtra < 8)
    display.screen[si-1] |= (save & (0xff >> rshift + xtra)); //test me!!!
  display.screen[si] |= temp << lshift;
}
} // end of bitmap

im confused because in the tetris one it takes all the necissary information to make the bitmaps
(in tetris it seems to be laying out the squares for where one of three things could be a full square, a ghost square or a empty square)
and it has all the cordinate info for the bitmap here
Code:
int index = bx/8 + x/2 + by*W/8 + y*4*W/8;
BUT instead of having it all nice and seperated like whats required in the OLED library it adds it all together BUT WHY i dont geddit because then it becomes an indecipherable mess of numbers
i have tried doing the numbers on paper and switching to binary and the like but nothing seems to work
i have also looked in the tv library files and it does not mention anything about a screen command

as for if this is bitmap
it is
but how? i do not know
3  Using Arduino / Displays / Re: TV out display.screen WHAT IS IT ?? on: July 11, 2012, 01:30:22 pm
in some spots the code is something like display.screen[index] &= b11110000 //this was from the tetris code

or something like that but it just dosent translate in any way to something that could be thought of as a bitmap command

for the Oled library this is the complete command for bitmaps
  display.clearDisplay();
  display.drawBitmap(30, 16,  logo16_glcd_bmp, 16, 16, 1);
  display.display();
it just dosnt make sense
4  Using Arduino / Displays / TV out display.screen WHAT IS IT ?? on: July 11, 2012, 03:06:37 am
currently i am working on porting the games made for the hackvision over to be able to use the OLED 128x64 B/W display from adafruit http://www.adafruit.com/products/326
and replacing the TVout with its library
and i keep coming across this command
Code:
display.screen[si++] &= ~(temp >> rshift);
or something similar it always starts with the display.screen and i know it deals with Bitmaps and such but there is NO mention of this command in the TVout library nor any of the libraries of the hackvision http://nootropicdesign.com/projectlab/2011/02/06/asteroids-on-hackvision/
and because i dont know what this command is i cannot change the command to the new library for the OLED display so im really stuck in a rut so to speak
i have found this stupid command in almost all of the libraries
PLEASE help i have a deadline in about 2 weeks
in the asteroids code it is in the main code at approximately line 1745 ish
thanks
5  Using Arduino / LEDs and Multiplexing / Re: trouble getting leds to light on 3.3v arduino pro mini with Lipo supply on: May 24, 2012, 12:07:28 am
.... well then... now i just feel really REALLY stupid  smiley-roll-sweat
6  Using Arduino / LEDs and Multiplexing / Re: trouble getting leds to light on 3.3v arduino pro mini with Lipo supply on: May 23, 2012, 11:40:32 pm
i have even tried removing the resistor and it still lights at the exact same brightness ok?
and when i supply it direcly with 3.3 volts with the resistor and led it lights up as it should
7  Using Arduino / LEDs and Multiplexing / Re: trouble getting leds to light on 3.3v arduino pro mini with Lipo supply on: May 23, 2012, 05:09:20 pm
330 ohm and about that.. i dont know it and it s not on the datasheet
http://www.sparkfun.com/products/10442
thats what i have the datasheet only gives info on the button not the led in the button people say about 2 something volts is best and current is about 50ma but its strange how the voltage on the pin drops so much
8  Using Arduino / LEDs and Multiplexing / trouble getting leds to light on 3.3v arduino pro mini with Lipo supply on: May 23, 2012, 04:38:35 pm
so when the led it supposed to light up (digitalWrite(5,HIGH) it lights but very dimly
the resistors are proper and the voltage when it is connected pin led resistor ground is about 1.6 volts to 1.8 volts

but when the pin is disconnected from the led it gives me 3.3 volts as it should im very confused because the power supply is able to handle this and if i hook directly to VCC>led>resistor>gnd it lights up really bright as it should
i am not sure why the voltage drops so much because i know i am within limitations because my decimilia works fine when i do this

i was thinking of putting in a transistor but i really dont have enough space to put it in
any help would be much appreciated
9  Using Arduino / Programming Questions / Re: Time and TimeAlarms Libraries – Ask here for help or suggestions on: May 14, 2012, 01:49:00 pm
the exact code i am running is the processing sketch from the time library and my port index is 3 because the arduino is on port 3
but even if i made no modifications to this code it still gives me an error
is there a way to just tell it what port number and do away with the serial list because i know the port and this is unnecissary
10  Using Arduino / Programming Questions / Re: Time and TimeAlarms Libraries – Ask here for help or suggestions on: May 12, 2012, 09:00:09 pm
hey im having some issues with the processing side of the library, on a fresh install of this code it will give an error saying array index out of bounds exception 1
on line 47 

it says at SyncArduinoClock.setup(SyncArduinoClock.java:47)
at processing.core.PAplet.handledraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(thread.java:662)

and in the code window it highlights

println(" Connecting to -> " + Serial.list()[portIndex]);

11  Using Arduino / Programming Questions / pot makes program hang on: February 10, 2012, 02:12:28 pm
so i am using the arduino on the BlinkM MinM http://blog.thingm.com/2011/03/blinkm-smart-led-as-the-smallest-arduino/
its really cool so i am making essentially a microcontroller that will take a reading from a POT and translate it to PWM signal output to drive a servomotor
HOWEVER sometimes when i turn the pot all the way up the program will hange and the light turns blue-green i need to check the pins but green usually is lit when the program starts when power is applied
blue is normally on and is essentially the PWM output that the servo is connected to
its connected just like this http://www.flickr.com/photos/todbot/5549460276/
the power source seems to be just about 5.1 volts so i think it MIGHT be that the high output on the analog read may be higher than the power source AKA higher than the reference voltage which may cause program hang
i could REALLY use some help with this and i am not to my knowledge using the pullup resistor on that line
thanks
~katzmatt
12  Forum 2005-2010 (read only) / Forum / Re: posting VERY large code programs on: March 31, 2010, 06:57:45 pm
umm no not really, is there any way to like upload a txt file or something?
13  Forum 2005-2010 (read only) / Forum / posting VERY large code programs on: March 31, 2010, 06:43:26 pm
i have a VERY VERY large program about 12345 bytes and around 1430 lines and i want to post it, can someone help me do this ? because if i make it all one post not even 1/4 fits in the 9500 character limit
help please!
14  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: AUTOSAVE on: March 29, 2010, 10:10:21 pm
YES exactly and good thinking of the alt file, like just something in the temp folder under <filename>AUTOSAVE<timestamp>.pde
this doesent sound too complex to implement either, i hope this gets into the next release
15  Forum 2005-2010 (read only) / Bugs & Suggestions / AUTOSAVE on: March 29, 2010, 12:53:37 pm
greetings fellow arduinoers
i wanted to make a suggestion to the next release of the arduino software is some function that you can check when you start up the software where it will automatically save changes every predefined time, like every 5 minutes or so , recently wrote about about a paragraph of comment explaining my complex code and explaining functions and interrupts and arrays and other BS (to non coders) and then the power goes out from the storm and all my stuff was lost and i must type it all in again so it doesent seem like much to ask for a simple sutosave script or something, it would make many people very happy  smiley
thank you
~Katzmatt
Pages: [1] 2 3 4