Jump to content
43oh

indirtwetrust

Members
  • Content Count

    7
  • Joined

  • Last visited

Everything posted by indirtwetrust

  1. I hope this is the right place to ask this but I’m having a problem with unsigned long. According to the Energia reference it should go to 4,294,967,295. But my unsigned long value is overflowing at 65535 same as unsigned int. I’m using it as a set point for millies based on a pot so I’m limited to about 60 seconds. Anything over 65535 wraps back around to zero giving me a time of what it’s set to minus 60 seconds. I’m sure there’s a work around but everything I can find says unsigned long should work. please help, thanks.
  2. Well I think I got it ! I sure appreciate your help. A couple of things had me hung up though. I couldn't get the if statements to recognize the state of an actual assigned output like && (relayPinUP == LOW). I had to make variables I called stateUP / stateDN in addition to my "toggle" variable to keep track of which output's turn it is to fire. But then when I tried to "digitalWrite(stateDN, HIGH)" or LOW, the variable would not change state. I had to use the "!" to toggle it instead. Also, not having a good understanding of how the timer worked I was trying to use a timer1
  3. This is the best I could do so far. I start with one output high, the first delay works and the output goes off, then the other output goes on (with a flicker) and locks up there, how can I start and stop the timers in the code in the IF statements? Also, i'll need to use some kind of variable to switch on and off, 1 or 0, true or false to keep the outputs alternating. I tried this but the format would not work if ((millis()-timer1)>sensorValue1) && toggle = 0){ ... Is there a decent cheat sheet for structure & formatting besides the single page one Have? I'll attac
  4. Thanks I will try that. I have read that delay should be avoided but I also read that delay in Energia doesn't just hold up the processor. I'll start with reading the link.
  5. Thanks again for your help. I attached the Sketch I have so far. It works as is for my original project but after adding an LCD for experimentation, I would like to re-write it so that the sensorValues update continuously instead of waiting until the delays end. I haven't been able to figure out how to do it yet, I was looking at the multi-tasking examples but I get errors when trying to compile those sketches with multiple tabs. Then to go 1 step further, it would be cool if the delay could be affected by turning the pot after it got the "delay sensorValue" command. Auto Call Program.tx
  6. Ya, that was it! Thank you so much. I had no idea I had to set the output low before declaring it an output.
  7. I wrote a sketch to fire 2 outputs back and forth with a pot to adjust the on time of the outputs and a pot to adjust the off time. The outputs are just LEDs for now and there is a 3rd LED that turns on when either output is on (so I can adjust the pots later when the outputs are only driving silent, solid state relays.) Every time the MSP430G2553 is powered up or reset, in the Launchpad or a bread board, all of the pins configured as outputs go high for about a second before the program starts to run There is a thread that comes up with a google search of the problem where everyone
×
×
  • Create New...