Servo library support (#1343)
* ateempt at bringin servos * basic plumbing * avoid math map duplicate * missing parts annontation * pretify parts * extend appcompat layer * updated strings * more compat layer * annotations * don't rely on webmidi * updated pxt ref * bump pxt * adding whenUsed * updated v1 readme * more pins * more pins * compress the parts definition * update common packages
This commit is contained in:
		
							
								
								
									
										5
									
								
								libs/servo/_locales/servo-jsdoc-strings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								libs/servo/_locales/servo-jsdoc-strings.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
  "servos.Servo.run": "Set the throttle on a continuous servo",
 | 
			
		||||
  "servos.Servo.run|param|speed": "the throttle of the motor from -100% to 100%",
 | 
			
		||||
  "servos.Servo.setAngle": "set the servo angle"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								libs/servo/_locales/servo-strings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								libs/servo/_locales/servo-strings.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
{
 | 
			
		||||
  "servos.P0|block": "servo P0",
 | 
			
		||||
  "servos.P1|block": "servo P1",
 | 
			
		||||
  "servos.P2|block": "servo P2",
 | 
			
		||||
  "servos.Servo.run|block": "continuous %servo run at %speed=speedPicker \\%",
 | 
			
		||||
  "servos.Servo.setAngle|block": "set %servo angle to %degrees=protractorPicker °",
 | 
			
		||||
  "servos.Servo.setPulse|block": "set %servo pulse to %micros μs",
 | 
			
		||||
  "{id:category}Servos": "Servos",
 | 
			
		||||
  "{id:group}Servos": "Servos"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										3
									
								
								libs/servo/pxt.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								libs/servo/pxt.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
{
 | 
			
		||||
    "additionalFilePath": "../../node_modules/pxt-common-packages/libs/servo"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								libs/servo/targetoverrides.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								libs/servo/targetoverrides.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
namespace servos {
 | 
			
		||||
    //% block="servo P0" fixedInstance whenUsed
 | 
			
		||||
    export const P0 = new servos.PinServo(pins.P0);
 | 
			
		||||
    //% block="servo P1" fixedInstance whenUsed
 | 
			
		||||
    export const P1 = new servos.PinServo(pins.P1);
 | 
			
		||||
    //% block="servo P2" fixedInstance whenUsed
 | 
			
		||||
    export const P2 = new servos.PinServo(pins.P2);
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user