Translate Arduino code to Proton Compiler.

Status
Not open for further replies.

Mondalot

Junior Member level 3
Joined
Sep 28, 2013
Messages
29
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
235
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:
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
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…