Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Translate Arduino code to Proton Compiler.

Status
Not open for further replies.

Mondalot

Junior Member level 3
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top