Why won't output change state? Problem with OLED text.

I have probably missed the obvious, but after a few hours this has all turned to mush to me. I have looked at this code and can't understand why pin 11 will not change states in the software I have attached. I can run it in a simple loop program on the same controller with the same hardware setup and it works just fine.

I am using a Pro Mini if that helps.

You will note that I have commented out everything else in the program loop just to test this output problem.

Additionally I have a .96" OLED and can't use the command code that allows me to over write a line of text with something else. I tried using oled.setTextColor(0xFFFF, 0) but it's not in the header library. Any recommendations?

InverterControlwithtransmissionProMini.ino (21 KB)

Pins 11 and 12 are the default pins for VirtualWire.
You reassigned one:

const int transmit_pin = 10; //pin assignment for rf transmission

vw_set_tx_pin(transmit_pin);

Maybe you need to reassign the other also?

int InvRelay = 11; //Set 11 as Inverter relay

int Refrelay = 12; //Set 12 as Refrigerator relay

I have in my notes for one of my projects that VirtualWire takes over pins 9 and 10 and that you must specify both the transmit and receive pins even if you are not transmitting.

"4.1 vw_set_tx_pin
extern void vw_set_tx_pin(uint8_t pin);
Set the digital IO pin to use for transmit data. Defaults to 12.
4.2 vw_set_rx_pin
extern void vw_set_rx_pin(uint8_t pin);
Set the digital IO pin to use for receive data. Defaults to 11."

"Caution: VirtualWire takes over Arduino Timer1, and this will affect the PWM capabilities
of the digital pins 9 and 10."

VirtualWire.pdf (138 KB)

You were dead on!! I had to assign the transmit and the receive pins even though I only have the transmitter on this end. I have done this before using an uno and didn't seem to have this problem. Thanks for your response. Any idea on the OLED problem?

rrfisher:
Any idea on the OLED problem?

Additionally I have a .96" OLED and can't use the command code that allows me to over write a line of text with something else.

Well, why can't you? Does the Arduino start belching smoke? Does it start singing "Yankee Doodle Dandy" off key?