@educabot/educablocks-boards 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ import type { Pin } from '../pins'
2
+
3
+ export enum BOARD_ITEM_TYPE {
4
+ BOOK = 'book',
5
+ ROBOT = 'robot',
6
+ DRONE = 'drone',
7
+ BOARD = 'board',
8
+ MODEL = 'model',
9
+ KIT = 'kit',
10
+ }
11
+
12
+ export enum BOARD_TYPE {
13
+ SENIOR = 'senior',
14
+ JUNIOR = 'junior'
15
+ }
16
+
17
+ export type BoardType = 'senior' | 'junior'
18
+
19
+ export type EnabledForCode = 1 | 0
20
+
21
+ export type Agent = {
22
+ max: string
23
+ linux: string
24
+ windows: string
25
+ }
26
+
27
+ export type Board = {
28
+ id: number,
29
+ type: BoardType,
30
+ image: string,
31
+ class: string,
32
+ name: string,
33
+ groupName: string,
34
+ company: string,
35
+ compilerBoard: string,
36
+ agentCommandLine: Agent | string,
37
+ agentSignature: Agent | string,
38
+ use1200bpsTouch: boolean,
39
+ fileExtension: string,
40
+ profile: string,
41
+ lang: string,
42
+ show: number,
43
+ showOnAula: number,
44
+ enabled: number,
45
+ enabledForCode: EnabledForCode,
46
+ premium: number,
47
+ elementType: BOARD_ITEM_TYPE,
48
+ pins: Partial<Pin>
49
+ toolboxLayout?: string,
50
+ groupClass?: string,
51
+ htmlValue?: string
52
+ }
package/src/pins.ts ADDED
@@ -0,0 +1,74 @@
1
+
2
+ export type PinSet = Array<Array<string>>
3
+
4
+ export type Pin = {
5
+ digital: PinSet
6
+ analog: PinSet,
7
+ pwm: PinSet
8
+ i2c: PinSet,
9
+ motorPwm?: PinSet
10
+ keyboard?: PinSet
11
+ ultrasonic?: PinSet
12
+ digitalServo?: PinSet
13
+ }
14
+
15
+ export const ARDUINO_UNO: Pin = {
16
+ digital: [['13', '13'], ['12', '12'], ['11', '11'], ['10', '10'], ['9', '9'], ['8', '8'], ['7', '7'], ['6', '6'], ['5', '5'], ['4', '4'], ['3', '3'], ['2', '2']],
17
+ analog: [['A0', 'A0'], ['A1', 'A1'], ['A2', 'A2'], ['A3', 'A3'], ['A4', 'A4'], ['A5', 'A5']],
18
+ pwm: [['~3', '3'], ['~5', '5'], ['~6', '6'], ['~9', '9'], ['~10', '10'], ['~11', '11']],
19
+ i2c: [['IIC', 'A4,A5']],
20
+ motorPwm: [['E3', '2,3,11'], ['E4', '5,4,9'], ['E6', '7,6,10']],
21
+ keyboard: [['1', '13'], ['2', '12'], ['3', '11'], ['4', '10'], ['5', '9'], ['6', '8'], ['7', '7'], ['8', '6']]
22
+ }
23
+
24
+ export const ARDUINO_MEGA: Pin = {
25
+ digital: [['53', '53'], ['52', '52'], ['51', '51'], ['50', '50'], ['49', '49'], ['48', '48'], ['47', '47'], ['46', '46'], ['45', '45'], ['44', '44'], ['43', '43'], ['42', '42'], ['41', '41'], ['40', '40'], ['39', '39'], ['38', '38'], ['37', '37'], ['36', '36'], ['35', '35'], ['34', '34'], ['33', '33'], ['32', '32'], ['31', '31'], ['30', '30'], ['29', '29'], ['28', '28'], ['27', '27'], ['26', '26'], ['25', '25'], ['24', '24'], ['23', '23'], ['22', '22'], ['21', '21'], ['20', '20'], ['19', '19'], ['18', '18'], ['17', '17'], ['16', '16'], ['15', '15'], ['14', '14'], ['13', '13'], ['12', '12'], ['11', '11'], ['10', '10'], ['9', '9'], ['8', '8'], ['7', '7'], ['6', '6'], ['5', '5'], ['4', '4'], ['3', '3'], ['2', '2']],
26
+ analog: [['A0', 'A0'], ['A1', 'A1'], ['A2', 'A2'], ['A3', 'A3'], ['A4', 'A4'], ['A5', 'A5'], ['A6', 'A6'], ['A7', 'A7'], ['A8', 'A8'], ['A9', 'A9'], ['A10', 'A10'], ['A11', 'A11'], ['A12', 'A12'], ['A13', 'A13'], ['A14', 'A14'], ['A15', 'A15']],
27
+ pwm: [['~13', '13'], ['~12', '12'], ['~11', '11'], ['~10', '10'], ['~9', '9'], ['~8', '8'], ['~7', '7'], ['~6', '6'], ['~5', '5'], ['~4', '4'], ['~3', '3'], ['~2', '2']],
28
+ i2c: [['IIC', 'A4,A5']],
29
+ ultrasonic: [['E3', '3,2'], ['E4', '4,5'], ['E6', '6,7']],
30
+ motorPwm: [['E3', '2,3,11'], ['E4', '5,4,9'], ['E6', '7,6,10']],
31
+ keyboard: [['1', '13'], ['2', '12'], ['3', '11'], ['4', '10'], ['5', '9'], ['6', '8'], ['7', '7'], ['8', '6']]
32
+ }
33
+
34
+ export const ZONDA: Pin = {
35
+ digital: [['13', '13'], ['12', '12'], ['11', '11'], ['10', '10'], ['9', '9'], ['8', '8'], ['7', '7'], ['6', '6'], ['5', '5'], ['4', '4'], ['3', '3'], ['2', '2']],
36
+ analog: [['A0', 'A0'], ['A1', 'A1'], ['A2', 'A2'], ['A3', 'A3'], ['A4', 'A4'], ['A5', 'A5']],
37
+ pwm: [['~3', '3'], ['~5', '5'], ['~6', '6'], ['~9', '9'], ['~10', '10'], ['~11', '11']],
38
+ i2c: [['IIC', 'A4,A5']],
39
+ ultrasonic: [['E3', '3,2'], ['E4', '4,5'], ['E6', '6,7']],
40
+ motorPwm: [['E3', '2,3,11'], ['E4', '5,4,9'], ['E6', '7,6,10']],
41
+ keyboard: [['1', '13'], ['2', '12'], ['3', '11'], ['4', '10'], ['5', '9'], ['6', '8'], ['7', '7'], ['8', '6']]
42
+ }
43
+
44
+ export const BHOOT: Pin = {
45
+ digital: [['0', 'A0'], ['1', 'A3'], ['2', '3'], ['3', '10'], ['4', '11']],
46
+ digitalServo: [['0', 'A0'], ['1', 'A3'], ['2', '3'], ['3', '10'], ['4', '11']],
47
+ analog: [['0', 'A0'], ['1', 'A3'], ['5', 'A6']],
48
+ pwm: [['2', '3'], ['3', '10'], ['4', '11']],
49
+ motorPwm: [['MD', '4,5'], ['MI', '7,6']],
50
+ i2c: [['IIC', 'A4,A5']],
51
+ ultrasonic: [['0', 'A0,A1'], ['1', 'A3,A2']]
52
+ }
53
+
54
+ export const ARDUINO_NANO: Pin = {
55
+ digital: [['13', '13'], ['12', '12'], ['11', '11'], ['10', '10'], ['9', '9'], ['8', '8'], ['7', '7'], ['6', '6'], ['5', '5'], ['4', '4'], ['3', '3'], ['2', '2']],
56
+ analog: [['A0', 'A0'], ['A1', 'A1'], ['A2', 'A2'], ['A3', 'A3'], ['A4', 'A4'], ['A5', 'A5'], ['A6', 'A6'], ['A7', 'A7']],
57
+ pwm: [['~3', '3'], ['~5', '5'], ['~6', '6'], ['~9', '9'], ['~10', '10'], ['~11', '11']],
58
+ i2c: [['IIC', 'A4,A5']],
59
+ }
60
+
61
+ export const ARDUINO_MICRO: Pin = {
62
+ digital: [['21', '21'], ['20', '20'], ['19', '19'], ['18', '18'], ['16', '16'], ['15', '15'], ['14', '14'], ['10', '10'], ['9', '9'], ['8', '8'], ['7', '7'], ['6', '6'], ['5', '5'], ['4', '4'], ['3', '3'], ['2', '2']],
63
+ // analog: [['A0', 'A0'], ['A1', 'A1'], ['A2', 'A2'], ['A3', 'A3'], ['A6', 'A6'], ['A7', 'A7'], ['A8', 'A8'], ['A9', 'A9'], ['A10', 'A10']],
64
+ analog: [['A0', '18'], ['A1', '19'], ['A2', '20'], ['A3', '21'], ['A6', '4'], ['A7', '6'], ['A8', '8'], ['A9', '9'], ['A10', '10']],
65
+ pwm: [['~3', '3'], ['~5', '5'], ['~6', '6'], ['~9', '9'], ['~10', '10']],
66
+ i2c: [['IIC', '2,3']],
67
+ }
68
+
69
+ export const ARDUINO_LEONARDO: Pin = {
70
+ digital: [['13', '13'], ['12', '12'], ['11', '11'], ['10', '10'], ['9', '9'], ['8', '8'], ['7', '7'], ['6', '6'], ['5', '5'], ['4', '4'], ['3', '3'], ['2', '2']],
71
+ analog: [['A0', 'A0'], ['A1', 'A1'], ['A2', 'A2'], ['A3', 'A3'], ['A4', 'A4'], ['A5', 'A5']],
72
+ pwm: [['~3', '3'], ['~5', '5'], ['~6', '6'], ['~9', '9'], ['~10', '10'], ['~11', '11'], ['~13', '13']],
73
+ i2c: [['IIC', '3,2']],
74
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2016",
4
+ "module": "commonjs",
5
+ "esModuleInterop": true,
6
+ "noImplicitAny": false,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "outDir": "dist",
11
+ "sourceMap": true
12
+ }
13
+ }