Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Datalogger attempt
- /* Quote by Shel-Game:
- The simple way to get in is the code 12 test.
- Basically, you send the SBEC 0x12 at 7815 baud until
- it replies with 0x12. Then you switch the baud to
- 62500 and re-send the 0x12 to confirm the datalogging mode.
- After that, the SBEC is in datalogging mode until you
- key it off. Once in datalogging mode, you simply send
- a single byte memory location and it replies with the data
- at that location. Pretty simple really.
- */
- byte tempByte=0;
- void setup() {
- pinMode(13, OUTPUT);
- Serial.begin(9600);
- Serial3.begin(7815);
- while(!Serial3.available()) {
- Serial.print("Attempting");
- Serial3.print(0x12);
- delay(50);
- }
- while (Serial3.available()) {
- tempByte=Serial3.read();
- if (Serial3.available()) {
- byte temp = Serial3.read();
- if (temp==0x12) {
- Serial.println("");
- Serial.println("First contact, success!");
- Serial3.end();
- Serial3.begin(62500);
- Serial3.print(0x12);
- digitalWrite(13, HIGH);
- delay(100);
- Serial3.flush();
- }
- else {
- Serial.print("Failed.");
- delay(1000);
- }
- }
- }
- }
- void loop() {
- for (byte memoryLocation = 0; memoryLocation<=255; memoryLocation++) {
- Serial.print("Memory Location: ");
- Serial.print(memoryLocation, HEX);
- Serial3.print(memoryLocation);
- delay(50);
- if (Serial3.available()) {
- Serial.print(" Content: ");
- Serial.println(Serial3.read(), HEX);
- delay(100);
- } else {
- Serial.println(" No Reply");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement