Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remote execution module #197

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,8 @@
"tabs": [
"Repl"
]
},
"remote_execution": {
"tabs": []
}
}
55 changes: 55 additions & 0 deletions src/bundles/remote_execution/ev3/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { Chapter } from 'js-slang/dist/types';

const ev3DeviceType = {
id: 'EV3',
name: 'Lego Mindstorms EV3',
// This list must be in the same order as the list here:
// https://github.com/source-academy/sinter/blob/master/devices/ev3/src/ev3_functions.c#L891
internalFunctions: [
'ev3_pause',
'ev3_connected',
'ev3_motorA',
'ev3_motorB',
'ev3_motorC',
'ev3_motorD',
'ev3_motorGetSpeed',
'ev3_motorSetSpeed',
'ev3_motorStart',
'ev3_motorStop',
'ev3_motorSetStopAction',
'ev3_motorGetPosition',
'ev3_runForTime',
'ev3_runToAbsolutePosition',
'ev3_runToRelativePosition',
'ev3_colorSensor',
'ev3_colorSensorRed',
'ev3_colorSensorGreen',
'ev3_colorSensorBlue',
'ev3_reflectedLightIntensity',
'ev3_ambientLightIntensity',
'ev3_colorSensorGetColor',
'ev3_ultrasonicSensor',
'ev3_ultrasonicSensorDistance',
'ev3_gyroSensor',
'ev3_gyroSensorAngle',
'ev3_gyroSensorRate',
'ev3_touchSensor1',
'ev3_touchSensor2',
'ev3_touchSensor3',
'ev3_touchSensor4',
'ev3_touchSensorPressed',
'ev3_hello',
'ev3_waitForButtonPress',
'ev3_speak',
'ev3_playSequence',
'ev3_ledLeftGreen',
'ev3_ledLeftRed',
'ev3_ledRightGreen',
'ev3_ledRightRed',
'ev3_ledGetBrightness',
'ev3_ledSetBrightness',
],
languageChapter: Chapter.SOURCE_3,
};

export default ev3DeviceType;
8 changes: 8 additions & 0 deletions src/bundles/remote_execution/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Module responsible for execution of Source on remote devices.
*
* @module remote_execution
* @author Richard Dominick
*/

export { default as EV3 } from './ev3';