Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Timer.h" // Side project
- #include <SoftwareSerial.h>
- // D2 == RX
- // D3 == TX
- // D4 == RST
- #define RX 2
- #define TX 3
- #define RST 4
- SoftwareSerial SIM8001(TX, RX);
- Timer t; // Side project
- const byte ledPin = 13; // Side project
- const byte interruptPin = A7; // Side project, including because "what if"
- int val = 0;
- volatile byte state = LOW;
- void setup() {
- pinMode(ledPin, OUTPUT); // Side project
- pinMode(RST, OUTPUT);
- digitalWrite(RST, HIGH);
- Serial.begin(4800);
- SIM8001.begin(4800);
- }
- void loop() {
- while (SIM8001.available()) {
- Serial.write(SIM8001.read());
- }
- while (Serial.available()) {
- digitalWrite(ledPin, HIGH); // Status check, if we're in this block or not.
- SIM8001.write(Serial.read());
- digitalWrite(ledPin, LOW); // And a flash confirms that this block occurred.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement