20
OmerFlame
47d

Regarding my last rant: I AM FUCKING DUMB!

When I receive data from the master Arduino, a hardware interrupt runs and oversteps my main loop stuff!

Lesson? NEVER WRITE HARDWARE LATCHES ON THE MAIN LOOP WITH A HARDWARE INTERRUPT WHICH IS MOST OF YOUR FUCKING CODE!!

Comments
  • 5
    Hello FUCKING DUMB! 👋
  • 2
  • 4
    Plot twist: DUMB is his girlfriends nickname.
  • 1
    Debugging is an art because you need to know where to look bro :)
  • 0
    @Demolishun why name in the first place?

    Couldn't it be the case that OP's gf is actually dumb and OP has talked her into getting banged?
  • 1
    @F1973 exactly, but you’re literally not getting ANY help because it’s an edge case in the community.
  • 1
    @OmerFlame That's why one has to experiment to find the root cause.
  • 1
    @F1973 yeah! Also, we have so much code on the Arduino and it says “instabilities may occur”, so that also confused me many times, thinking that was the issue
  • 1
    @OmerFlame What does your setup do?
  • 1
    @F1973 alright, so we have an Arduino Mega which is the master computer, and we have an Arduino Uno which is the slave (RACIST OMFG /s). The master communicates with the slave through I2C, the slave reads the bytes sent, parses them and just puts them on a SPI-controlled screen in the respective place. When you want to change to memory-fed values, you press a button and then it needs to write MEM at the bottom of the screen.
  • 1
    @OmerFlame Got that HOW it works.

    I am asking WHAT it does? What's the use case or problem you are trying to solve?
  • 1
    @F1973 oh, I already solved it lol.

    So what happened is that I have a function that works as a hardware interrupt (slave-side) when the slave receives or being requested data, and I have a main loop that the slave runs on, separate from the interrupt. I wanted to check if that button is being pressed outside the interrupt, but it completely shat itself every damn time because most of the code and the code that runs most frequently is the interrupt, and interrupts come before normal code! They INTERRUPT normal activity. So I tried to put the check in the interrupt, and voila! Works.
  • 1
    @OmerFlame No, I am not helping you to solve the use case or issue you are facing.

    I am trying to understand the purpose or why you built this in first place.

    I am still confused but okay.. as long as it is working we are good.
  • 2
    @F1973 oh, I’m building a digitally controlled and monitored analog equalizer for studios with my dad lol
  • 1
    @OmerFlame lol now we are clear on this.

    Makes sense. Thanks :D
  • 1
    @OmerFlame by any chance are you @Rantsomwhere?
  • 1
    @F1973 sorry for not understanding your question, makes me look pretty stupid lol
  • 1
  • 1
    @OmerFlame Hahaha you are FUCKING DUMB :P
  • 1
  • 1
    Soooo... No I2C?
  • 1
Add Comment