PDA

View Full Version : How translate Arduino code to Proton.



Denner
- 25th July 2016, 12:55
Hello, All


I have a problem with an engine acceleration PWM works with analog joystick of the PS3 and accelerating very fast.
with this code I found quite solves the problem and is much smoother.
The only thing I do not understand many parts, so that they can write in Proton.


Arduino Code:


void loop() {


potval=analogRead(potentiometer);
potval=map(potval,0,1023,0,180);


while(curval<potval){
potval=analogRead(potentiometer);
potval=map(potval,0,1023,0,180);
curval=curval+1;
ESC.write(curval);
SoftwareServo::refresh();
Serial.println(curval);
delay(50);}


THX.

Ioannis
- 25th July 2016, 16:37
This is Melabs Pic Basic forum. Maybe you have to ask this in the http://www.protonbasic.co.uk/forum.php forum.

Ioannis

Denner
- 26th July 2016, 08:02
Hey,

Ok, Thx.