Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
universal.h
00001 #ifndef UNIVERSAL_H 00002 #define UNIVERSAL_H 00003 00004 // Define devices 00005 Motor left(p22, p16, p15); // pwm, fwd, rev 00006 Motor right(p23, p19, p20); // pwm, fwd, rev 00007 BusOut myled(LED1,LED2,LED3,LED4); 00008 RGBLed myRGBled(p26, p25, p24); // red, green, blue 00009 rgbSensor rgbsensor(p28, p27, p30); 00010 Serial blue(p13, p14); // serial tx, serial rx 00011 Serial pc(USBTX, USBRX); //debugging 00012 enum speed_state { accelerating, braking, coasting, pause }; 00013 enum left_right { left_dir, right_dir, straight }; 00014 00015 //Game state variables 00016 bool running = true; 00017 int progress = 0; 00018 int position = 1; 00019 int current_item = 0; 00020 bool holding_item = false; 00021 bool itembox = false; 00022 bool is_hit = false; 00023 bool powerup = false; 00024 bool victory = false; 00025 float speed_cmd = 0.0; 00026 float max_speed = 0.8; 00027 float acceleration_rate = 0.04; 00028 float brake_rate = 0.1; 00029 float coast_rate = 0.02; 00030 float left_multiplier = 1.0; 00031 float right_multiplier = 1.0; 00032 int cstate; 00033 speed_state sstate = coasting; 00034 left_right l_r = straight; 00035 bool collide = false; 00036 #endif
Generated on Fri Aug 12 2022 03:25:54 by
1.7.2