Skip to content

Commit b99941e

Browse files
committed
unused read node id from resistor value
1 parent f3b5bf6 commit b99941e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

SensorGridPM/SensorGridPM.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,18 @@ void custom_setupLoRa(int csPin, int resetPin, int irqPin)
367367
}
368368
*/
369369

370+
void readNodeId()
371+
{
372+
/* This approach does not seem accurate enough to be useful */
373+
// true analog pin. do not set pin mode
374+
Serial.println("Reading node id ..");
375+
analogWrite(A0, 341); // 1 volt
376+
pinMode(A1, INPUT);
377+
Serial.print("A1 voltage: ");
378+
Serial.println(analogRead(A1));
379+
while(1);
380+
}
381+
370382
void setup() {
371383
rtcz.begin();
372384
systemStartTime(rtcz.getEpoch());
@@ -375,8 +387,10 @@ void setup() {
375387
while ( !Serial && (millis() - _start) < WAIT_SERIAL_TIMEOUT ) {}
376388
config.loadConfig();
377389
nodeId(config.node_id);
390+
//nodeId(4);
378391
setupSensors();
379-
setupLoRa(config.RFM95_CS, config.RFM95_RST, config.RFM95_INT);
392+
//setupLoRa(config.RFM95_CS, config.RFM95_RST, config.RFM95_INT);
393+
setupLoRa(atoi(DEFAULT_RFM95_CS), atoi(DEFAULT_RFM95_RST), atoi(DEFAULT_RFM95_INT));
380394

381395
/*
382396
runner.init();

0 commit comments

Comments
 (0)