![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ll
Dependencies: mbed TextLCD MMA8451Q
main.cpp@0:f9c8e84340f6, 2020-11-26 (annotated)
- Committer:
- juankafil1
- Date:
- Thu Nov 26 04:14:30 2020 +0000
- Revision:
- 0:f9c8e84340f6
- Child:
- 1:a53d08aeb6ff
pores
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
juankafil1 | 0:f9c8e84340f6 | 1 | #include "mbed.h" |
juankafil1 | 0:f9c8e84340f6 | 2 | |
juankafil1 | 0:f9c8e84340f6 | 3 | Ticker rampa; |
juankafil1 | 0:f9c8e84340f6 | 4 | |
juankafil1 | 0:f9c8e84340f6 | 5 | BusOut step_secuence(PTA12,PTD4,PTA2,PTA2);//step_secuence=1010 |
juankafil1 | 0:f9c8e84340f6 | 6 | DigitalOut myled(LED1); |
juankafil1 | 0:f9c8e84340f6 | 7 | int contador =0,second; |
juankafil1 | 0:f9c8e84340f6 | 8 | float retardo,operacionrampa; |
juankafil1 | 0:f9c8e84340f6 | 9 | void rampa1(){ |
juankafil1 | 0:f9c8e84340f6 | 10 | |
juankafil1 | 0:f9c8e84340f6 | 11 | contador=contador+1; |
juankafil1 | 0:f9c8e84340f6 | 12 | if (contador>=10){ |
juankafil1 | 0:f9c8e84340f6 | 13 | contador=10; |
juankafil1 | 0:f9c8e84340f6 | 14 | } |
juankafil1 | 0:f9c8e84340f6 | 15 | } |
juankafil1 | 0:f9c8e84340f6 | 16 | int main() { |
juankafil1 | 0:f9c8e84340f6 | 17 | rampa.attach(&rampa1,second*0.1); |
juankafil1 | 0:f9c8e84340f6 | 18 | //ejemplo , |
juankafil1 | 0:f9c8e84340f6 | 19 | // second |
juankafil1 | 0:f9c8e84340f6 | 20 | //rpm |
juankafil1 | 0:f9c8e84340f6 | 21 | //operacionrampa=60/rpm*numeropasos*10 |
juankafil1 | 0:f9c8e84340f6 | 22 | |
juankafil1 | 0:f9c8e84340f6 | 23 | wait(operacionrampa*contador); |
juankafil1 | 0:f9c8e84340f6 | 24 | |
juankafil1 | 0:f9c8e84340f6 | 25 | |
juankafil1 | 0:f9c8e84340f6 | 26 | } |