Skip to content

Commit 4972c55

Browse files
committed
Updated libraries with examples
1 parent e373ec8 commit 4972c55

File tree

7 files changed

+229
-0
lines changed

7 files changed

+229
-0
lines changed

microNode-1.0.2.tar.bz2

-1.13 MB
Binary file not shown.

microNode-1.0.3.tar.bz2

1.12 MB
Binary file not shown.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#include <fram.h>
2+
3+
/*
4+
* FRAM can be used to perminantly store values through power cycles
5+
* The fram fitted can store 2048 bytes
6+
* Addresses 0 -> 2047
7+
*/
8+
9+
void setup() {
10+
FRAMinit();
11+
12+
Serial.begin(9600);
13+
}
14+
15+
void loop() {
16+
uint16_t i = 0;
17+
18+
for(i = 0; i < 2048; i++){
19+
// FRAMwrite(address, value tostore)
20+
FRAMwrite(i, i);
21+
}
22+
23+
Serial.println("Values written to FRAM");
24+
delay(2000);
25+
26+
for(i = 0; i < 2047; i++){
27+
// FRAMread(addess)
28+
uint8_t value = FRAMread(i);
29+
30+
Serial.print("Address ");
31+
Serial.print(i);
32+
Serial.print(" = ");
33+
Serial.println(value);
34+
}
35+
36+
Serial.println("All addresses read");
37+
38+
delay(5000);
39+
40+
41+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include <led.h>
2+
3+
/*
4+
* Available colours
5+
* OFF
6+
* BLUE RED
7+
* GREEN PINK
8+
* CYAN WHITE
9+
*
10+
*/
11+
12+
void setup() {
13+
//Initilise the RGB LED pins
14+
RGBinit();
15+
}
16+
17+
void loop() {
18+
//RGBset , used to set the colour of the LED
19+
RGBset(OFF);
20+
delay(500);
21+
RGBset(BLUE);
22+
delay(500);
23+
RGBset(GREEN);
24+
delay(500);
25+
RGBset(CYAN);
26+
delay(500);
27+
RGBset(RED);
28+
delay(500);
29+
RGBset(PINK);
30+
delay(500);
31+
RGBset(WHITE);
32+
delay(500);
33+
34+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#include <fram.h>
2+
#include <LoRa.h>
3+
#include <packetEncoder.h>
4+
5+
6+
int counter = 0;
7+
8+
uint8_t AppSKey[] = { 0xC3, 0xC2, 0x4B, 0x73, 0x46, 0x53, 0x57, 0x85, 0x5A, 0x0B, 0xC9, 0xAC, 0x55, 0x3A, 0x6B, 0xB7 };
9+
uint8_t NwkSKey[] = { 0xB2, 0xE3, 0x7A, 0x84, 0xC6, 0xF1, 0x79, 0xD3, 0xE2, 0xE6, 0x1B, 0x8F, 0xF9, 0xB7, 0x19, 0x95 };
10+
uint32_t DevAddr = 0x26011C27;
11+
12+
void setup() {
13+
14+
LoRa.setPins(25, 30, 26);
15+
16+
if (!LoRa.begin(868500E3)) {
17+
digitalWrite(12,HIGH);
18+
while (1);
19+
}
20+
21+
pinMode(2,OUTPUT);
22+
23+
LoRa.setSpreadingFactor(9);
24+
LoRa.setCodingRate4(5);
25+
LoRa.setSignalBandwidth(125E3);
26+
LoRa.setSyncWord(0x34);
27+
LoRa.enableCrc();
28+
29+
FRAMinit();
30+
}
31+
32+
void loop() {
33+
34+
uint8_t value = FRAMread(0);
35+
value++;
36+
FRAMwrite(0, value);
37+
38+
uint16_t raw = analogRead(A4);
39+
uint16_t volt = (2* raw * 3300)/1024;
40+
41+
uint8_t payload[3];
42+
payload[0] = value;
43+
payload[1] = uint8_t(volt >> 8);
44+
payload[2] = uint8_t(volt);
45+
46+
uint8_t payloadLength = 3;
47+
48+
uint8_t buffer1[MAXPAYLOAD];
49+
uint8_t len = generatePacket(payload, payloadLength, DevAddr, NwkSKey, AppSKey, buffer1);
50+
51+
// send packet
52+
LoRa.beginPacket();
53+
54+
for(int i = 0; i < len; i++) {
55+
LoRa.write(buffer1[i]);
56+
}
57+
58+
LoRa.endPacket();
59+
60+
digitalWrite(2,HIGH);
61+
delay(10000);
62+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#include <LoRa.h>
2+
#include <packetEncoder.h>
3+
4+
int counter = 0;
5+
6+
uint8_t AppSKey[] = { 0xF2, 0x06, 0x9B, 0x04, 0x12, 0x20, 0xD7, 0x88, 0xB5, 0x6E, 0x38, 0xF7, 0xD2, 0xAE, 0x68, 0x9A };
7+
uint8_t NwkSKey[] = { 0xFD, 0x46, 0xEC, 0xBD, 0x21, 0x17, 0x4D, 0x04, 0x72, 0x10, 0x1A, 0x6A, 0x2C, 0x06, 0x4E, 0x56 };
8+
uint32_t DevAddr = 0x26011400;
9+
10+
void setup() {
11+
12+
LoRa.setPins(25, 30, 26);
13+
14+
if (!LoRa.begin(868500E3)) {
15+
digitalWrite(13,HIGH);
16+
while (1);
17+
}
18+
19+
LoRa.setSpreadingFactor(7);
20+
LoRa.setCodingRate4(5);
21+
LoRa.setSignalBandwidth(125E3);
22+
LoRa.setSyncWord(0x34);
23+
LoRa.enableCrc();
24+
}
25+
26+
void loop() {
27+
28+
29+
uint8_t payload[] = "Hello World :) ";
30+
31+
uint8_t payloadLength = 14;
32+
33+
uint8_t buffer1[MAXPAYLOAD];
34+
uint8_t len = generatePacket(payload, payloadLength, DevAddr, NwkSKey, AppSKey, buffer1);
35+
36+
// send packet
37+
LoRa.beginPacket();
38+
39+
for(int i = 0; i < len; i++) {
40+
LoRa.write(buffer1[i]);
41+
}
42+
43+
LoRa.endPacket();
44+
45+
digitalWrite(12,HIGH);
46+
delay(200);
47+
digitalWrite(12, LOW);
48+
49+
counter++;
50+
51+
delay(5000);
52+
}

package_loranodes_index.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,46 @@
232232
"version": "4.0.0-atmel"
233233
}
234234
]
235+
},
236+
{
237+
"version": "1.0.3",
238+
"boards": [
239+
{
240+
"name": "microNode"
241+
}
242+
],
243+
"archiveFileName": "microNode-1.0.3.tar.bz2",
244+
"checksum": "SHA-256:8f41eb6bfa7995cf2e8bce69442f7923c2c5f00b6cede3cf5a4a66c7b4c7a85a",
245+
"url": "https://github.com/loranodes/arduino-core/raw/1.0.3/microNode-1.0.3.tar.bz2",
246+
"size": 1178446,
247+
"architecture": "samd",
248+
"name": "LoRaNodes M0 Boards",
249+
"category": "LoRaNodes",
250+
"help": {
251+
"online": "https://github.com/loranodes"
252+
},
253+
"toolsDependencies": [
254+
{
255+
"name": "arm-none-eabi-gcc",
256+
"packager": "arduino",
257+
"version": "4.8.3-2014q1"
258+
},
259+
{
260+
"name": "bossac",
261+
"packager": "arduino",
262+
"version": "1.6.1-arduino"
263+
},
264+
{
265+
"name": "openocd",
266+
"packager": "arduino",
267+
"version": "0.9.0-arduino"
268+
},
269+
{
270+
"name": "CMSIS",
271+
"packager": "arduino",
272+
"version": "4.0.0-atmel"
273+
}
274+
]
235275
}
236276
]
237277
}

0 commit comments

Comments
 (0)