Skip to content

Commit f4b03cd

Browse files
committed
Added library examples + fixed system lib
1 parent b6bb867 commit f4b03cd

File tree

5 files changed

+381
-268
lines changed

5 files changed

+381
-268
lines changed

index.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@
3737
toInsert['toolsDependencies'] = []
3838

3939
tool1 = {"name": "arm-none-eabi-gcc", "packager": "arduino", "version": "4.8.3-2014q1"}
40-
tool2 = {"name": "bossac", "packager": "arduino", "version": "1.6.1-arduino"}
41-
tool3 = {"name": "openocd", "packager": "arduino", "version": "0.9.0-arduino"}
42-
tool4 = {"name": "CMSIS", "packager": "arduino", "version": "4.0.0-atmel"}
40+
tool2 = {"name": "bossac", "packager": "arduino", "version": "1.7.0"}
41+
tool3 = {"name": "openocd", "packager": "arduino", "version": "0.9.0-arduino6-static"}
42+
tool4 = {"name": "CMSIS", "packager": "arduino", "version": "4.5.0"}
43+
tool5 = {"name": "CMSIS-Atmel", "packager": "arduino", "version": "1.1.0"}
44+
tool6 = {"name": "arduinoOTA", "packager": "arduino", "version": "1.2.0"}
45+
4346

4447
toInsert['toolsDependencies'].append(tool1)
4548
toInsert['toolsDependencies'].append(tool2)
4649
toInsert['toolsDependencies'].append(tool3)
4750
toInsert['toolsDependencies'].append(tool4)
51+
toInsert['toolsDependencies'].append(tool5)
52+
toInsert['toolsDependencies'].append(tool6)
4853

4954

5055
data['packages'][0]['platforms'].append(toInsert)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#include <led.h>
2+
#include "PCF2123.h"
3+
4+
5+
/*
6+
* Used to set the time in the RTC on the board
7+
* date needs to be sent to the board in the format
8+
*
9+
* -58-14-15-31-2-07-18
10+
* -SS-MM-HH-DD-WD-MM-YY
11+
*
12+
* This can be done using the linux command:
13+
* $date +-%S-%M-%H-%d-%u-%m-%y > /dev/ttyACM0
14+
*
15+
* where ttyACM0 is the serial port of the board
16+
*/
17+
18+
//Create an instance of the RTC lib
19+
PCF2123 time(A5);
20+
21+
uint8_t readVal();
22+
23+
void setup(){
24+
Serial.begin(9600);
25+
Serial.flush();
26+
RGBinit();
27+
//Initilise the RTC
28+
time.begin();
29+
}
30+
31+
void loop(){
32+
RGBset(RED);
33+
while(Serial.available() == 0);
34+
35+
//Create a instance of the time struct
36+
Time t;
37+
38+
//Fill the time struct with the data over serial
39+
40+
t.Second = readVal();
41+
t.Minute = readVal();
42+
t.Hour = readVal();
43+
t.Day = readVal();
44+
t.Wday = readVal();
45+
t.Month = readVal();
46+
t.Year = readVal();
47+
48+
49+
//Fetch the current time from the RTC into the struct
50+
time.set_time(t);
51+
RGBset(GREEN);
52+
Serial.println("Time set");
53+
delay(5000);
54+
}
55+
56+
uint8_t readVal(){
57+
Serial.read();
58+
return Serial.parseInt();
59+
}
60+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ uint16_t readVCC(){
3939
uint32_t voltage = valueRead * 4 * 1000;
4040
voltage /= 4096;
4141

42-
return voltage;
42+
return voltage * 4;
4343
}

0 commit comments

Comments
 (0)