Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
i tred this code and it doidnt worked.This code let's you use the atmega both ways it to show you how it work from there you can go on and do what you want.
Code:#include <SoftwareSerial.h> SoftwareSerial mySerial(2, 3); // RX, TX void setup() { // Open serial communications and wait for port to open: Serial.begin(57600); while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only } } void loop() { // run over and over if (mySerial.available()) { Serial.write(mySerial.read()); } if (Serial.available()) { mySerial.write(Serial.read()); } }
#define rxPin 2
#define txPin 3
#define ledPin 7
#include <SoftwareSerial.h>
SoftwareSerial mySerial(rxPin, txPin);
int state = 0;
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
mySerial.begin(9600); // Default communication rate of the Bluetooth module
}
void loop() {
if(mySerial.available() > 0){ // Checks whether data is comming from the serial port
state = mySerial.read(); // Reads the data from the serial port
}
if (state == '0') {
digitalWrite(ledPin, LOW); // Turn LED OFF
mySerial.println("LED: OFF"); // Send back, to the phone, the String "LED: ON"
state = 0;
}
else if (state == '1') {
digitalWrite(ledPin, HIGH);
mySerial.println("LED: ON");;
state = 0;
}
}
That doesn't tell me nothing did you hook it up like i posted in post 26 ???doesent work
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(57600);
mySerial.begin(38400);
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}