Search results

  1. Duhjoker

    Storing images or image data on SD (gaming)

    I'm trying to add a button function for the collision triggers for room changes and text and what ever so when I'm bumping into people objects they only popup when collision is made and "B" button is pressed. The one I'm working on is supposed to do 4 things, make a pop up message, add an item...
  2. Duhjoker

    Storing images or image data on SD (gaming)

    On my GameR console that uses buttons, I can move the player in a northwest direction by pressing both left and up buttons. I would like to be able to use slanted directions but I cant tell if its gonna be a hardware problem since currently moving the stick at an angle does nothing but up or...
  3. Duhjoker

    Storing images or image data on SD (gaming)

    I fixed the collision so the popups stay up while the player is touching a trigger bitmap. it was as simple as replacing the integer in direction repeat to the same integer used in the direction repeat at top. I know that sounds confusing so ill post the correction...
  4. Duhjoker

    Storing images or image data on SD (gaming)

    I changed the repeat frequency to 50 which looks better with the animation but the response time is still spotty and some times you have to push the stick in the reverse direction before the opposite side works. Other times it works fine. I'm wondering if decreasing the pwm frequency in the...
  5. Duhjoker

    Storing images or image data on SD (gaming)

    its lil splotchy though and now I'm having a collision problem. Its colliding but my popup messages only flash because now the player wont stay on the collision to keep the text bubble up on the screen. something to do with move direction repeat 0 being with in the collision call. I tried to...
  6. Duhjoker

    Storing images or image data on SD (gaming)

    I got it working properly. I went ahead and just made 4 new if functions using the extra parenthesis example posted earlier in the thread and transcribed it to the other three movements. I made progress by adding last x and last y in the loop past the last movement if. left started repeating...
  7. Duhjoker

    Storing images or image data on SD (gaming)

    Could the problem be with the pwm out puts paired with the timer? PWM as I understand it is a timed pulse, the longer the push the longer the pulse is. Could it be the elapsed millis commands messing with the pwm timers?
  8. Duhjoker

    Storing images or image data on SD (gaming)

    the direction thig is mixed up due to the rotation of the joys on the console. ones turned 90* the other270*. Ok i once again checked that the board was working properly using the adafruit example. They both work. I changed every thing to resemble the above but no change. If i use my original...
  9. Duhjoker

    Storing images or image data on SD (gaming)

    now i have everything but left going but there is a glitch. the player only moves up or right til the menu pops up then down can be accessed but no left. ive been staring at it for a while and i just don't see it. Yes int y = ss1.analogRead(2); and int x = ss1.analogRead(3); are in the loop. i...
  10. Duhjoker

    Storing images or image data on SD (gaming)

    ok I don't get it. I can get up to work but but if i repeat the variables given i get nothing but up. struct Player { int player_x; int player_y; int room; int player_direction; int player_directionRepeat; }; Player player = { 160, 170, 3, 2, 0}; int y = ss1.analogRead(2)...
  11. Duhjoker

    Storing images or image data on SD (gaming)

    ok so I changed my player to match the stuff you added but I get no change.... int y = ss1.analogRead(2); int x = ss1.analogRead(3); int player_directionRepeat = 0; // Zero to start and reset to zero anytime no movement was requested int MoveRepeat = 0; #define MoveRepeatRate 100 //...
  12. Duhjoker

    Storing images or image data on SD (gaming)

    Well yea the player can only move one direction at a time. heres a break down of my player movement.... int y = ss1.analogRead(2); // reads analog input y int x = ss1.analogRead(3); // reads analog input x if(x > 600 && last_x < 600){ ////if x is greater than 600 and last x...
  13. Duhjoker

    Storing images or image data on SD (gaming)

    all right so I got the new analog controls and buttons programmed in to my game example. But I cant figure out to make the joystick movement repeat. I can only move my player object once per stick movement which doesn't work at all. Any clue as to how I can make the analog movements repeat when...
  14. Duhjoker

    Storing images or image data on SD (gaming)

    Remove the second part of each movement and the last part as seen below and it runs stable.... //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /////////// board rotation = 270* int y =...
  15. Duhjoker

    Storing images or image data on SD (gaming)

    I get what your saying guys but I just don't have the room for soldering extra pins or the wiring it would take. kinda got every thing packed tight into a little case. There's actually another example included in the seesaw library I had not checked out. Joy wing oled example that prints a...
  16. Duhjoker

    Storing images or image data on SD (gaming)

    I don't understand enough what abs or the analog is doing in order to fix it. I was trying to make it if x -3 and greater than 3 do function. every thing I do just gives me constant string. And really cant see away to use the original function with functions in them int x = ss1.analogRead(2)...
  17. Duhjoker

    Storing images or image data on SD (gaming)

    They have adapters for teensy 3.2 and i think they once produced a teensy feather. But don't quote me. Its a neat set up though. I made a wooden case for mine. ok so heres the deal I made this set up which works and only outputs when a button or direction is placed. int x =...
  18. Duhjoker

    Storing images or image data on SD (gaming)

    I could have swore someone told me to use bounce with. Oh well. I wonder if there's a way to make the buttons repeat though. Uhhmmm is there some kind of calibration I could do. The analogs are constantly outputting movement in the serial monitor. Seems to be stuck on down which means when the...
  19. Duhjoker

    Storing images or image data on SD (gaming)

    ok I don't know if I did this right but it compiles and works but its real spotty. if ( (abs(x - last_x) > 3)){ Serial.println("right"); last_x = x; } if ( (abs(x + last_x) < 3)){ Serial.println("left"); last_x = x; } if ( (abs(y + last_y) < 3)){ Serial.println("up")...
  20. Duhjoker

    Storing images or image data on SD (gaming)

    OK how do I turn this analog stuff..... if ( (abs(x - last_x) > 3) || (abs(y - last_y) > 3)) { Serial.print(x); Serial.print(", "); Serial.println(y); last_x = x; last_y = y; } into something like this? if(tft.Brepeat(BTN_UP,1)){...
  21. Duhjoker

    Storing images or image data on SD (gaming)

    Sorry I didn't know there was another post before posting my last post. Awesome thank you!!!! They both work now. when looking at the serial monitor the joys put out a constant string of integers so when you press the tactile buttons you only see a flash of the button pressed. I take it this...
  22. Duhjoker

    Storing images or image data on SD (gaming)

    ok I doubled the parts I think are need but I still cant get both joys running at the same time... #include "Adafruit_seesaw.h" Adafruit_seesaw ss; #define BUTTON_RIGHT 6 /////////////what are these integers #define BUTTON_DOWN 7 /////////////" " #define BUTTON_LEFT 9...
  23. Duhjoker

    Storing images or image data on SD (gaming)

    well you were right about reaction times. I visually could not see a time delay between pressing the button and the buttons name appearing in the serial monitor box. I just cant seem to get both to work at the same time. The joys have LED's which lets me know which is working yay! but I cant...
  24. Duhjoker

    Storing images or image data on SD (gaming)

    Ok only using one i2c bus means I only I had to change one function in the seesaw file. Which would be the begin. the change is to allow the second address. #define SEESAW_ADDRESS (0x49) #define SEESAW_ADDRESS2 (0x4a) bool Adafruit_seesaw::begin(uint8_t addr1...
  25. Duhjoker

    Storing images or image data on SD (gaming)

    see that's where I get confused. The adafruit page calls them all gpio and analog pins. Does that mean they can be digital I/O or analog? heres the pinout from pins_arduino. iy list some as analog but lower down it also gives them a T number. what are the T numbers representing? #define...
  26. Duhjoker

    Storing images or image data on SD (gaming)

    I decided to go ahead and add the interrupt lines so the button states can be read. what pin capabilities are needed to use the interrupts.
  27. Duhjoker

    Storing images or image data on SD (gaming)

    are saying just use both on one bus
  28. Duhjoker

    Storing images or image data on SD (gaming)

    ok I did this void Adafruit_seesaw::_i2c_init() { Wire.begin(); Wire.begin2(); } and then this bool Adafruit_seesaw::begin(uint8_t addr1, uint8_t addr2) { _i2caddr = addr1; _i2caddr2 = addr2; _i2c_init(); SWReset(); delay(500); uint8_t c = this->read8(SEESAW_STATUS_BASE...
  29. Duhjoker

    Storing images or image data on SD (gaming)

    ok it compiles but its untested heres what I did... wire.h class TwoWire: public Stream { protected: uint8_t num; int8_t sda; int8_t scl; int8_t sda2; //////added by duhjoker int8_t scl2; //////" " i2c_t * i2c; uint8_t...
  30. Duhjoker

    Storing images or image data on SD (gaming)

    Most of the problems ive been fixing or updating here lately have been visual. Like a popup function that can be used to easily display text bubbles when certain conditions are met. Or the buttons library I just added to the grafx libraries that makes it easier to add button controls. Some code...
  31. Duhjoker

    Storing images or image data on SD (gaming)

    ok heres the deal. I'm working with two libraries, the t3 library and esp32 library. As it stands, testing both libraries requires me to switch out the MCU every other time I need to test something. Major PITA!!! So I wanted to have a console for each library. Unfortunately I cant get any...
  32. Duhjoker

    Storing images or image data on SD (gaming)

    What all did you have to change in the seesaw library to account for the second set of pin? If you don't mind
  33. Duhjoker

    Storing images or image data on SD (gaming)

    Ohhh ok i see it now. Ive been reading about I2c hardware and am i to understand that when i use two different sets of i2c pins that one needs to be an output capable pin and an input capable pin? Do these pin sets need to be analog or digital IO’s? Im not seeing the pin declarations on the...
  34. Duhjoker

    Storing images or image data on SD (gaming)

    I'm looking at the pic below of the I2c wiring and why does the green wire use two pins? Also the left side hits the second pinright of the first while the green wire on the right hits the second pin 1 down? What is the white wire?
  35. Duhjoker

    Storing images or image data on SD (gaming)

    Do the I2c lines take care of the tactile switches as well? Also do you gyts know of any humanized tutorials on I2C? Like setting up pins and stuff?! Im having trouble understanding which vias besides the power pins need need header pins. Ive got sda and sdl populated. Do i need another set of pins
  36. Duhjoker

    Storing images or image data on SD (gaming)

    You know the GameR library has a lot of neat stuff inside and it was created here with the expert help of the people just for gaming . I love the case!! Will you be releasing the .stl files? I also like the idea of the i2c’s less wiring but im lil worried about the reaction time. Both gamebuino...
  37. Duhjoker

    Storing images or image data on SD (gaming)

    When in doubt ask tge manufacturer!! I asked adafruit about the resistor and they linked me to the tutorial which says that sda and scl have pullups already built into to those ports on the feather wing joys. https://learn.adafruit.com/joy-featherwing?view=all#i2c-data-pins
  38. Duhjoker

    Storing images or image data on SD (gaming)

    What size is preferred? I also have the 10m ohm
  39. Duhjoker

    Storing images or image data on SD (gaming)

    Ive actually got some blue 10k resistors, would those be sufficient? Or would that be over kill?
  40. Duhjoker

    Storing images or image data on SD (gaming)

    Its says in docs for the joy that it uses 12c and that you need a pull up resistor. Did you use the teensys on board pullup or do i need a 10k resistor? Also do i need to bridge the gap on the address pads to use two feathers?
  41. Duhjoker

    Button problems

    ok since I'm having trouble coming up with a way to separate the button functions using the bounce method,Yet... I want to use the button theme that came with the OG Gamebuino libaray. #include "Buttons.h" void Buttons::begin() { pins[BTN_LEFT] = BTN_LEFT_PIN; pins[BTN_UP] =...
  42. Duhjoker

    switching button controls from one function to another

    Once i removed the timer on one of my functions, it started working right. Are there timers pre-installed or do i need a crystal to use them? My updateAll command uses timers as well in millis but ive never gotten to work when dropping functions in it. Theres a definite reason i ask that...
  43. Duhjoker

    switching button controls from one function to another

    ok guys what am I missing? Why cant I get the button functions to pause for others? void controls(){ ButtonUp.update(); ButtonUp.rebounce(10); ButtonDown.update(); ButtonDown.rebounce(10);ButtonLeft.update(); ButtonLeft.rebounce(10);ButtonRight.update(); ButtonRight.rebounce(10)...
  44. Duhjoker

    switching button controls from one function to another

    All right guys ive read up on program structure, function structure and variable structures, My latest fail was this lil bit of code. it was supposed to check for the state then use the proper function to either move the cursor or move the player. void ButtonOutputs() { //start with...
  45. Duhjoker

    switching button controls from one function to another

    Ok I'm out of knowledgeable options I'm still trying to get the cursor to move but it wont. The weird part is that the cursor does show up when in menu mode and down or up are pressed and disappears when in player mode. This tells me the function is partially working but not as it should. So the...
  46. Duhjoker

    switching button controls from one function to another

    ugghh. I haven't made any progress but ive been busy making some much needed changes. The main thing was changing my player stuff to a structure. For some reason I though that might help with the controls switch. I also added a collision system to the menu function for when I get the controls to...
  47. Duhjoker

    switching button controls from one function to another

    I found a toggle example on an Arduino page and I was trying something like this.... void Menu(){ //if (ButtonA.fallingEdge()){ if(digitalRead(buttonA) == HIGH){ Button = 1 - Button; } if (Button == 1 && OldButton == 0){ tft.writeRectNBPP(0,0,136,20,4,menul1,palette)...
  48. Duhjoker

    switching button controls from one function to another

    ok well I had marked out the next state part in the player state so it didn't have a way to change it. void loop(void) { if(state == STATE_Menu){ Menu(); controls(); state = STATE_Menu; nextState = STATE_Player; } else if(state == STATE_Player){ drawplayer(); controls()...
  49. Duhjoker

    switching button controls from one function to another

    Ok I have restructured the program a lil to add the else if thing to the controls. Then I ended up having to put the function in my ino file instead of its own header. #include <GrafxT3.h> #include <SPIN.h> #include <SPI.h> #include <Bounce.h> #include "Variables.h" #include "Player.h"...
  50. Duhjoker

    switching button controls from one function to another

    ok let me ask for a clarification...... Create a function, we will call it controls so void controls(). And in this function I add an else if loop. So I can give it if variable A = player use this set of controls and list the controls then do an else if variable B = menu use this set of...
Back
Top