File tree 1 file changed +0
-44
lines changed
content/micropython/01.basics/08.reference 1 file changed +0
-44
lines changed Original file line number Diff line number Diff line change @@ -394,50 +394,6 @@ while True:
394
394
noTone(5 ,1 )
395
395
```
396
396
397
- ### pulseIn()
398
-
399
- ** Example:**
400
-
401
- ``` python
402
- import machine
403
-
404
- def pulseIn (pin , level , timeout = 1000000 ):
405
- pulse_start = machine.time_pulse_us(machine.Pin(pin), level, timeout)
406
- pulse_end = machine.time_pulse_us(machine.Pin(pin), not level, timeout)
407
- return pulse_end - pulse_start
408
- ```
409
-
410
- ### shiftIn()
411
-
412
- ** Example:**
413
-
414
- ``` python
415
- import machine
416
-
417
- def shiftIn (dataPin , clockPin , bitOrder = machine.MSBFIRST ):
418
- value = 0
419
- for i in range (8 ):
420
- value |= machine.Pin(dataPin).value() << (7 - i)
421
- machine.Pin(clockPin).value(1 )
422
- machine.Pin(clockPin).value(0 )
423
- return value
424
- ```
425
-
426
- ### shiftOut()
427
-
428
- ** Example:**
429
-
430
- ``` python
431
- import machine
432
-
433
- def shiftOut (dataPin , clockPin , bitOrder = machine.MSBFIRST , value ):
434
- for i in range (8 ):
435
- mask = 1 << i if bitOrder == machine.LSBFIRST else 1 << (7 - i)
436
- machine.Pin(dataPin).value(bool (value & mask))
437
- machine.Pin(clockPin).value(1 )
438
- machine.Pin(clockPin).value(0 )
439
- ```
440
-
441
397
## Math
442
398
443
399
### abs()
You can’t perform that action at this time.
0 commit comments