First post here and I have been working with ESP01 for about 2 weeks. I have been programming mostly my whole life.
Anyway, I am trying to flesh out a wireless receiver and controller for the atari 2600. I am tired of having to sit close to the TV lol. I know there are solutions out there but I wanted to put my programming into use for something new and have physical form.
I am using an esp01 with a 74hc165 on a breadboard with some buttons to send a byte with bits corresponding to which buttons are pressed to another esp01 with a 74hc595 to take that data and put it out to the console. To test this I have put a led on each pin of the 595 so it will go off when the button is pressed. So far everything is working. I push a button it sends the data to the esp correctly (confirmed in the serial monitor) but the corresponding led doesn't light. I have been fighting this for a bit. In my frustration I loaded up a simple 595 sketch that lights up 8 leds to ensure the 595 was working properly and it is. Using the simple 8 led sketch I started to put things in from the console receiver sketch. I started with the configuration of the WIFI and used the same 8 LED pattern to display while the module WIFI.status() != WL_CONNECTED. Running this shows some sort of interference or maybe too much going on in the ESP. Has anyone seen anything like this before? The pattern is there but you can see some of the leds are skipped .
/*
Adafruit Arduino - Lesson 4. 8 LEDs and a Shift Register
*/
#include <ESP8266WiFi.h>
int latchPin = 3;//12
int clockPin = 2;//11
int dataPin = 0;//14
byte leds = 0;
const char* ssid = "ATRECEIVE2600";
const char* pass = "A2600Vin";
IPAddress host(192,168,4,2);
void setup()
{
pinMode(3, FUNCTION_3);
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
Serial.begin(9600);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pass);
}
void loop()
{
if(WiFi.status() != WL_CONNECTED)
{
leds = 0;
updateShiftRegister();
delay(500);
for (int i = 0; i < 8; i++)
{
bitSet(leds, i);
updateShiftRegister();
delay(500);
}
}
}
void updateShiftRegister()
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, LSBFIRST, leds);
digitalWrite(latchPin, HIGH);
}
Just wondering if anyone else had seen this. I have not found a whole lot on the esp using wireless and a 595, and im also new and just learning the hardware side of things but Im out of ideas and thought I would ask for some help.
Thanks in advance