16

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
  • 4
    Hello FUCKING DUMB! 👋
  • 1
  • 3
    Plot twist: DUMB is his girlfriends nickname.
  • 0
    @F1973 exactly, but you’re literally not getting ANY help because it’s an edge case in the community.
  • 0
    @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
  • 0
    @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.
  • 0
    @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
    @F1973 oh, I’m building a digitally controlled and monitored analog equalizer for studios with my dad lol
  • 0
    @F1973 sorry for not understanding your question, makes me look pretty stupid lol
  • 0
    @F1973 nope
  • 0
    @F1973 LMFAO
  • 1
    Soooo... No I2C?
  • 1
Add Comment