Skip to content

Commit cd5053e

Browse files
authored
Merge pull request #52 from PropGit/BlocklyProp
Blockly prop
2 parents 90b0bce + 1e9d07a commit cd5053e

File tree

121 files changed

+12071
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+12071
-2
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Arlo - Control System Adjustments.c
3+
*/
4+
5+
#include "simpletools.h"
6+
#include "arlodrive.h"
7+
8+
char *reply;
9+
10+
int main()
11+
{
12+
print("CHECK CONSTANTS\n\n");
13+
print("To DHB-10 From DHB-10\n");
14+
print("----------- ----------------\n");
15+
16+
print("KI\\r ");
17+
reply = dhb10_com("KI\r");
18+
if(*reply == '\r') print("\\r\n");
19+
else print("%s", reply);
20+
21+
print("DZ\\r ");
22+
reply = dhb10_com("DZ\r");
23+
if(*reply == '\r') print("\\r\n");
24+
else print("%s", reply);
25+
26+
print("\n\nSET CONSTANTS\n\n");
27+
print("To DHB-10 From DHB-10\n");
28+
print("----------- ----------------\n");
29+
30+
print("KI 65\\r ");
31+
reply = dhb10_com("KI 65\r");
32+
if(*reply == '\r') print("\\r\n");
33+
else print("%s\n", reply);
34+
35+
print("DZ 1\\r ");
36+
reply = dhb10_com("DZ 1\r");
37+
if(*reply == '\r') print("\\r\n");
38+
else print("%s\n", reply);
39+
40+
41+
print("\n\nSTORE CONSTANTS\n\n");
42+
print("To DHB-10 From DHB-10\n");
43+
print("----------- ----------------\n");
44+
45+
print("STORE KI\\r ");
46+
reply = dhb10_com("STORE KI\r");
47+
if(*reply == '\r') print("\\r\n");
48+
else print("%s\n", reply);
49+
50+
print("STORE DZ\\r ");
51+
reply = dhb10_com("STORE DZ\r");
52+
if(*reply == '\r') print("\\r\n");
53+
else print("%s\n", reply);
54+
55+
print("\nAll done!\n");
56+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Arlo - Control System Adjustments.c
2+
>compiler=C
3+
>memtype=cmm main ram compact
4+
>optimize=-Os
5+
>-m32bit-doubles
6+
>-fno-exceptions
7+
>defs::-std=c99
8+
>-lm
9+
>BOARD::ACTIVITYBOARD
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
Arlo - No Surprise Maneuvers.c
3+
4+
Run this before ever turning on power to the Arlo's motors to prevent any
5+
unexpected motions.
6+
*/
7+
8+
#include "simpletools.h" // Include simple tools
9+
#include "arlodrive.h" // Include arlo drive
10+
11+
int main() // Main function
12+
{
13+
freqout(4, 2000, 3000); // Beep -> program starting
14+
print("Your Arlo will stay still\n"); // Success message
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Arlo - No Surprise Maneuvers.c
2+
>compiler=C
3+
>memtype=cmm main ram compact
4+
>optimize=-Os
5+
>-m32bit-doubles
6+
>-fno-exceptions
7+
>defs::-std=c99
8+
>-lm
9+
>BOARD::ACTIVITYBOARD
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
Arlo - Serial through arlodrive.c
3+
*/
4+
5+
#include "simpletools.h" // Include simple tools
6+
#include "arlodrive.h"
7+
8+
char *reply;
9+
10+
int main() // Main function
11+
{
12+
print("SPEED & DISTANCE\n\n");
13+
print("To DHB-10 From DHB-10\n");
14+
print("------------- ----------------\n");
15+
16+
print("RST\\r ");
17+
reply = dhb10_com("RST\r");
18+
if(*reply == '\r') print("\\r\n");
19+
else print("%s", reply);
20+
21+
print("gospd 32 32\\r ");
22+
reply = dhb10_com("gospd 32 32\r");
23+
if(*reply == '\r') print("\\r\n");
24+
else print("%s", reply);
25+
26+
pause(2000);
27+
28+
print("gospd 0 0\\r ");
29+
reply = dhb10_com("gospd 0 0\r");
30+
if(*reply == '\r') print("\\r\n");
31+
else print("%s", reply);
32+
33+
// Display distance reply as text
34+
print("dist\\r ");
35+
reply = dhb10_com("dist\r");
36+
if(*reply == '\r') print("\\r\n");
37+
else print("%s", reply);
38+
39+
print("------------- ----------------\n");
40+
41+
// Convert distance reply text to numeric values to use in
42+
// calculations, and display the results stored by int variables.
43+
int countLeft, countRight;
44+
print("\nVARIABLE VALUES\n", reply);
45+
sscan(reply, "%d%d", &countLeft, &countRight);
46+
print("countLeft = %d, countright = %d\n", countLeft, countRight);
47+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Arlo - Serial through arlodrive.c
2+
>compiler=C
3+
>memtype=cmm main ram compact
4+
>optimize=-Os
5+
>-m32bit-doubles
6+
>-fno-exceptions
7+
>defs::-std=c99
8+
>-lm
9+
>BOARD::ACTIVITYBOARD
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
Arlo Serial through fdserial.c
3+
*/
4+
5+
#include "simpletools.h"
6+
#include "fdserial.h"
7+
8+
#define SERVO_L 12
9+
10+
char dhb10_reply[48];
11+
char *reply;
12+
13+
fdserial *arlo;
14+
15+
char *config(void);
16+
17+
int main()
18+
{
19+
arlo = fdserial_open(SERVO_L, SERVO_L, 0b1100, 19200);
20+
pause(10);
21+
22+
print("SPEED & DISTANCE\n\n");
23+
print("To DHB-10 From DHB-10\n");
24+
print("------------- ----------------\n");
25+
26+
print("gospd 32 32\\r ");
27+
dprint(arlo, "gospd 32 32\r");
28+
reply = config();
29+
if(*reply == '\r') print("\\r\n");
30+
else print("%s", reply);
31+
32+
pause(2000);
33+
34+
print("gospd 0 0\\r ");
35+
dprint(arlo, "gospd 0 0\r");
36+
reply = config();
37+
if(*reply == '\r') print("\\r\n");
38+
else print("%s", reply);
39+
40+
// Display distance reply as text
41+
print("dist\\r ");
42+
dprint(arlo, "dist\r");
43+
reply = config();
44+
if(*reply == '\r') print("\\r\n");
45+
else print("%s", reply);
46+
47+
print("------------- ----------------\n");
48+
49+
// Convert distance reply text to numeric values to use in
50+
// calculations, and display the results stored by int variables.
51+
int countLeft, countRight;
52+
print("\nVARIABLE VALUES\n", reply);
53+
sscan(reply, "%d%d", &countLeft, &countRight);
54+
print("countLeft = %d, countright = %d\n", countLeft, countRight);
55+
}
56+
57+
char *config(void)
58+
{
59+
memset(dhb10_reply, 0, 48);
60+
int i = 0, cta = 0, ca = 0;
61+
int t = CNT;
62+
int dt = CLKFREQ;
63+
while(1)
64+
{
65+
cta = fdserial_rxCount(arlo);
66+
if(cta)
67+
{
68+
ca = readChar(arlo);
69+
dhb10_reply[i] = ca;
70+
if(dhb10_reply[i] == '\r')
71+
{
72+
reply = dhb10_reply;
73+
break;
74+
}
75+
i++;
76+
}
77+
if(CNT - t > dt)
78+
{
79+
*reply = 0;
80+
break;
81+
}
82+
}
83+
return reply;
84+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Arlo - Serial through fdserial.c
2+
>compiler=C
3+
>memtype=cmm main ram compact
4+
>optimize=-Os
5+
>-m32bit-doubles
6+
>-fno-exceptions
7+
>defs::-std=c99
8+
>-lm
9+
>BOARD::ACTIVITYBOARD
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
Arlo - SimpleIDE Terminal Command Mode.c
3+
Communicate with Arlo through the SimpleIDE Terminal.
4+
*/
5+
6+
#include "simpletools.h"
7+
#include "arlodrive.h"
8+
9+
int main()
10+
{
11+
while(1)
12+
dhb10_terminal(SIDE_TERM);
13+
print("Back in main program.");
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Arlo - SimpleIDE Terminal Command Mode.c
2+
>compiler=C
3+
>memtype=cmm main ram compact
4+
>optimize=-Os
5+
>-m32bit-doubles
6+
>-fno-exceptions
7+
>defs::-std=c99
8+
>-lm
9+
>BOARD::ACTIVITYBOARD

0 commit comments

Comments
 (0)