Hello,
I am pretty new to all of this and im having some trouble with getting multiple displays running, in essence for my project I need to have the stream of information from 10 Pressure Transducers displayed on 10 TM1637 Displays, one Pressure Transducer per display.
I have managed to get it to work singularly (one Pressure Transducer to show its pressure on one TM1637) but I cannot figure out how to take it to the next step and get another to work on the same arduino.
I am using the Arduino Mega and the library that I am using for the TM1637 is here: GitHub - avishorp/TM1637: Arduino library for TM1637 (LED Driver)
This is the code i have working:
#include <Arduino.h>
#include <TM1637Display.h>
#define CLK_1 22
#define DIO_1 26
TM1637Display
display(CLK_1, DIO_1);
const int PressureTransducer_1 = A0;
int PressureTransducerReading_1 = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
display.setBrightness(0x0e);
uint8_t data[] = { 0x0, 0x0, 0x0, 0x0 };
int reading_1 = analogRead(PressureTransducer_1);
float voltage = reading_1 * 5.0;
voltage /= 1023.0;
float PressurePSI_1 = (voltage - 0.5) * 10 ;
display.showNumberDec(PressurePSI_1, true, 4,0);
delay(1000);
Serial.print(PressurePSI_1); Serial.println(" PSI");
}
Any Ideas? thanks.