GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DOC: update misc article pages · smallbasic/smallbasic.github.io@c5ffcb6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • _build/pages
    • android.markdown
    • community.markdown
    • escape.markdown
    • features.markdown
    • guide.markdown
    • links.markdown
    • sdl.markdown
    • trycatch.markdown
  • css
    • style.css
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎_build/pages/android.markdown‎

Copy file name to clipboard
+45-32Lines changed: 45 additions & 32 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,59 @@
1-
** Using Location, Sensor and Text to speech services **
1+
Android
2+
=======
23

3-
Applies to version 0.12.8
4+
> Using Location, Sensor and Text to speech services. Applies to version 0.12.8 (and above)
45
56
To use the following services, your program must start with the following two lines:
7+
68
```
79
option predef load modules
810
import android
911
```
1012

1113
The first line tell SmallBASIC to dynamically load runtime modules. The second line imports the android module.
1214

13-
1. Location
15+
## Location
1416

1517
GPS_ON
18+
1619
```
1720
android.gps_on()
1821
```
1922

2023
Instructs the system to commence recording location information. Note: This relies on the device location services being enabled by the user.
2124

2225
GPS_OFF
26+
2327
```
2428
android.gps_off()
2529
```
2630

2731
Turns off recording of location information.
2832

2933
LOCATION
34+
3035
```
3136
l = android.location()
3237
```
3338

3439
Returns a MAP variable holding the following details:
3540

36-
latitude - the latitude, in degrees.
37-
longitude - the longitude, in degrees.
38-
speed - the speed if it is available, in meters/second over ground.
39-
accuracy - the estimated accuracy of this location, in meters.
40-
altitude - altitude if available, in meters
41-
bearing - the bearing, in degrees
42-
provider - whether data obtained from GPS or network
41+
- latitude - the latitude, in degrees.
42+
- longitude - the longitude, in degrees.
43+
- speed - the speed if it is available, in meters/second over ground.
44+
- accuracy - the estimated accuracy of this location, in meters.
45+
- altitude - altitude if available, in meters
46+
- bearing - the bearing, in degrees
47+
- provider - whether data obtained from GPS or network
4348

4449
Note: the location data is updated internally at 1 second intervals.
4550

46-
For more details, see: https://developer.android.com/reference/android/location/Location.html
51+
For more details, see: <https://developer.android.com/reference/android/location/Location.html>
4752

48-
2. Sensor
53+
## Sensor
4954

5055
SENSOR_ON
56+
5157
```
5258
const SensorAccelerometer = 0
5359
const SensorMagneticField = 1
@@ -60,76 +66,84 @@ android.sensor_on(n)
6066
Enables the given sensor (currently only one may be enabled at a time). Throws an exception if the given sensor is not available (for example, not all devices have a gyroscope).
6167

6268
SENSOR_OFF
69+
6370
```
6471
android.sensor_off()
6572
```
6673

6774
Disables any active sensor.
6875

6976
SENSOR
77+
7078
```
7179
s = android.sensor()
7280
```
7381

7482
Returns a MAP variable holding sensor details.
7583
x, y, z - The spatial position
76-
light - (SensorLight)
84+
light - (SensorLight)
7785
distance - (SensorProximity)
7886

7987
For more details, see:
80-
http://i.stack.imgur.com/skBui.jpg
81-
https://developer.android.com/reference/android/hardware/SensorEvent.html
8288

83-
3. Text to speech
89+
- <http://i.stack.imgur.com/skBui.jpg>
90+
- <https://developer.android.com/reference/android/hardware/SensorEvent.html>
91+
92+
## Text to speech
8493

85-
Output data as spoken text.
94+
Output data as spoken text.
8695

8796
Notes:
8897
- The text to speech module takes a moment to initialise. This is performed the first time you call SPEAK.
8998
- You may want to turn off the system setting to send TTS usage statistics to google before using this feature.
9099

91100
TTS_PITCH
101+
92102
```
93103
android.tts_pitch(n)
94104
```
95105

96106
Sets the voice pitch (default is 1.0).
97107

98108
TTS_RATE
109+
99110
```
100111
android.tts_rate(n)
101112
```
102113

103114
Sets the rate of speaking (default is 1.0)
104115

105116
TTS_LANG
117+
106118
```
107119
android.tts_lang(s)
108120
```
109121

110122
Sets the locale, for example "en", "de", "fr" for English, German, France. May cause the system to download the language codec if not already installed.
111123

112124
TTS_OFF
125+
113126
```
114127
android.tts_off()
115128
```
116129

117-
Turns off text to speech output.
130+
Turns off text to speech output.
118131

119132
SPEAK
133+
120134
```
121135
android.speak(text)
122136
```
123137

124138
Performs text to speech (default is ENGLISH).
125139

126-
** How to edit and run a program **
140+
## How to edit and run a program
127141

128-
1. Internal editor:
142+
### Internal editor:
129143
- Display the menu, then click Editor [ON]
130-
- Tap a file name in the browser.
144+
- Tap a file name in the browser.
131145

132-
2. Desktop SmallBASIC
146+
### Desktop SmallBASIC
133147
- Enter the port number in the setup screen.
134148
- Connect your desktop machine and your mobile device to the same wifi network.
135149
- Launch desktop SmallBASIC.
@@ -139,40 +153,39 @@ Performs text to speech (default is ENGLISH).
139153
- Enter the security code, then press enter.
140154
- Once the settings are successful, you can press F4 to upload your program again.
141155

142-
3. File browser:
156+
### File browser:
143157
- Write and debug the program with desktop SmallBASIC.
144158
- Copy the .bas file to your SDCard.
145159
- Launch SmallBASIC, then navigate to the file in the built-in file browser, then tap the link to run.
146160
- or, navigate to the file in the system file browser, then tap the link to start SmallBASIC and run the program.
147161

148-
4. Separate editor on device:
162+
### Separate editor on device:
149163
- Write your SmallBASIC program in a separate editor on your device.
150164
- Task switch to SmallBASIC, then run the program using the built-in file browser.
151165

152-
5. Web Service:
166+
### Web Service:
153167
- Enter the port number in the setup screen.
154168
- Connect your desktop machine and your mobile device to the same wifi network.
155169
- Launch a desktop browser then enter http://:
156170
- A simple web page is displayed. Enter your SmallBASIC program then click run.
157171

158-
6. QRcode:
172+
### QRcode:
159173
- Write and debug the program with desktop SmallBASIC.
160174
- Convert the program to an QRCode image.
161175
- Scan the QRCode in the separate decoder program.
162176
- Click okay to launch SmallBASIC and the encoded program.
163177

164178
Note: the tool to convert source code to QR codes is here: https://github.com/smallbasic/SmallBASIC/tree/master/web/qrcode
165179

166-
** Playing music **
167-
168-
Applies to version 0.12.8
180+
## Playing music
169181

170182
PLAY("file:///sdcard/VoiceRecorder/recordings/hello.mp3")
171183

172184
Use the PLAY command with the prefix "file://" to play an audio track. For supported formats, see:
173185

174-
https://developer.android.com/guide/appendix/media-formats.html
186+
<https://developer.android.com/guide/appendix/media-formats.html>
187+
188+
## Release history
175189

176-
** Release history **
177-
http://smallbasic.sourceforge.net/?q=node/1217
190+
[Android changelog](android_changelog.html)
178191

Collapse file

‎_build/pages/community.markdown‎

Copy file name to clipboardExpand all lines: _build/pages/community.markdown
+1-2Lines changed: 1 addition & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
contact page
1+
# Community
32

43
<strong>Email:</strong>
54
<a href="mailto:[email protected]">[email protected]</a>
Collapse file

‎_build/pages/escape.markdown‎

Copy file name to clipboardExpand all lines: _build/pages/escape.markdown
+4-6Lines changed: 4 additions & 6 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Escape codes
2+
13
SmallBASIC supports a number of escape codes for controlling the display. The codes allow you to set foreground and background colors, change the font and also set underline and inverse text display.
24

3-
The escape codes are based on "ANSI Codes" (http://en.wikipedia.org/wiki/ANSI_escape_code). The android and FLTK versions of SmallBASIC also support a number of additional codes which are not part of the standard.
5+
The escape codes are based on "ANSI Codes" (http://en.wikipedia.org/wiki/ANSI_escape_code). SmallBASIC also support a number of additional codes which are not part of the standard.
46

57
Escape sequences start with the characters ESC (ASCII 27d / 1Bh / 033o ) and [ (left bracket). This sequence is called CSI for "Control Sequence Introducer".
68

@@ -21,7 +23,6 @@ The supported standard codes are:
2123
\e[24m set underline off
2224
\e[27m set reverse off
2325
\e[nm n colors - 30..37 foreground, 40..47 background
24-
2526
```
2627

2728
Useful non-standard codes include:
@@ -30,17 +31,14 @@ Useful non-standard codes include:
3031
\e[ A<text> Displays an alert box
3132
\e[ K Displays the virtual keyboard
3233
\e[ L Displays a label at the bottom of the screen
33-
3434
```
3535

3636
The CHR command is useful for obtaining and printing the escape character (ASCII 27)
3737

3838
For example:
3939

40-
~~~
41-
40+
```
4241
10 PRINT CHR(27) + "[1mTHIS IS BOLD" + CHR(27) + "[0m"
4342
20 PRINT CHR(27) + "[3mThis is italic" + CHR(27) + "[0m"
4443
30 PRINT CHR(27) + "[4mThis is underline"
45-
4644
```
Collapse file

‎_build/pages/features.markdown‎

Copy file name to clipboardExpand all lines: _build/pages/features.markdown
+4-2Lines changed: 4 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
SmallBASIC has a number of new features intended to broaden its appeal as a general purpose scripting language.
1+
# New features
2+
3+
> SmallBASIC has a number of new features intended to broaden its appeal as a general purpose scripting language (Note - Written in 2008).
24
35
## Local variable declaration and assignment ##
46

@@ -146,7 +148,7 @@ b = " and this is another string
146148

147149
## Double equals ##
148150

149-
BASIC traditionally uses a single equals symbol for assignment and comparison, for example:
151+
BASIC traditionally uses a single equals symbol for assignment and comparison, for example:
150152

151153
```
152154
a = "cat"

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.