Hi
I having some troubles, I need make something like this:
If one button is pushed, the Arduino Uno is informed, it could be done with digital and analog entrances, but I need more than 40 buttons and it should be done with only one wire for data.
This is my code for ATTINY: (sending 1.5 in the last line, because I do not know how send the float point “ponto”)
#include <SoftwareSerial.h>
float ponto = 1.0;
int rxPin = 2;
int txPin = 3;
SoftwareSerial ATTSerial = SoftwareSerial(rxPin, txPin);
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
ATTSerial.begin(9600);
}
void loop()
{
mySerial.print("1.50");
delay(100);
}
And for Arduino:
float c;
void setup()
{
Serial.begin(9600);
pinMode(8, OUTPUT); //not used now
digitalWrite(8, LOW);
}
void loop()
{
if(Serial.available() > 0) {
c = Serial.parseFloat();
Serial.println(c);
}
}
I see in the Monitor Serial sometimes 1.50, and then the monitor serial don’t show anything more.
What is wrong here?
And how make the Attiny send the float point?
Thank you.