# error: esc controller code errors

**URL:** <https://forum.arduino.cc/t/error-esc-controller-code-errors/387731>\
**Category:** General Guidance\
**Created:** [May 23, 2016, 7:09pm UTC](https://forum.arduino.cc/t/error-esc-controller-code-errors/387731 "2016-05-23T19:09:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcles011](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@mcles011](https://forum.arduino.cc/u/mcles011)\
**Post date:** [May 23, 2016, 7:09pm UTC](https://forum.arduino.cc/t/error-esc-controller-code-errors/387731/1 "2016-05-23T19:09:33Z")

</div>

this is the code that i have tried for making a Bluetooth phone controlled longboard.  
the errors are beyond me, can anyone help?

code:

void setup()  
{  
int LED= 12;  
char input;  
}

Serial.begin(9600);  
pinMode(LED, OUTPUT);  
Serial.println("\>\> START\<\<");

{  
if(Serial.available()\>0)  
{  
input= Serial.read();  
if(input=='1')  
{  
Serial.println("ON");  
digitalWrite(LED, HIGH);  
delay(2000);  
}  
else if(input=='0')  
{  
Serial.println("OFF");  
digitalWrite(LED, LOW);  
delay(2000);  
}  
else  
{  
Serial.println("NO INPUT");  
Serial.println(input);  
}  
}

}

errors:

Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"

electric\_longboard\_v1:7: error: 'Serial' does not name a type

Serial.begin(9600);

^

electric\_longboard\_v1:8: error: expected constructor, destructor, or type conversion before '(' token

pinMode(LED, OUTPUT);

^

electric\_longboard\_v1:9: error: 'Serial' does not name a type

Serial.println("\>\> START\<\<");

^

electric\_longboard\_v1:11: error: expected unqualified-id before '{' token

{

^

exit status 1  
'Serial' does not name a type

This report would have more information with  
"Show verbose output during compilation"  
option enabled in File -\> Preferences.

[electric\_longboard\_v1.ino](https://forum.arduino.cc/uploads/short-url/sKpguThOTYNSCjx4XsFzOIKi4p7.ino) (552 Bytes)

---

<div class="post-metadata">

**Author:** ![ieee488](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@ieee488](https://forum.arduino.cc/u/ieee488)\
**Post date:** [May 23, 2016, 7:11pm UTC](https://forum.arduino.cc/t/error-esc-controller-code-errors/387731/2 "2016-05-23T19:11:20Z")

</div>

> mcles011:  
> this is the code that i have tried for making a Bluetooth phone controlled longboard.  
> the errors are beyond me, can anyone help?
> 
> code:
> 
> void setup()  
> {  
> int LED= 12;  
> char input;  
> **}**  **\<---- WRONG**
> 
> Serial.begin(9600);  
> pinMode(LED, OUTPUT);  
> Serial.println("\>\> START\<\<");
> 
> {  
> if(Serial.available()\>0)  
> {  
> input= Serial.read();  
> if(input=='1')  
> {  
> Serial.println("ON");  
> digitalWrite(LED, HIGH);  
> delay(2000);  
> }  
> else if(input=='0')  
> {  
> Serial.println("OFF");  
> digitalWrite(LED, LOW);  
> delay(2000);  
> }  
> else  
> {  
> Serial.println("NO INPUT");  
> Serial.println(input);  
> }  
> }
> 
> }
> 
> errors:
> 
> Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"
> 
> electric\_longboard\_v1:7: error: 'Serial' does not name a type
> 
> Serial.begin(9600);
> 
> ^
> 
> electric\_longboard\_v1:8: error: expected constructor, destructor, or type conversion before '(' token
> 
> pinMode(LED, OUTPUT);
> 
> ^
> 
> electric\_longboard\_v1:9: error: 'Serial' does not name a type
> 
> Serial.println("\>\> START\<\<");
> 
> ^
> 
> electric\_longboard\_v1:11: error: expected unqualified-id before '{' token
> 
> {
> 
> ^
> 
> exit status 1  
> 'Serial' does not name a type
> 
> This report would have more information with  
> "Show verbose output during compilation"  
> option enabled in File -\> Preferences.

---

<div class="post-metadata">

**Author:** ![mcles011](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@mcles011](https://forum.arduino.cc/u/mcles011)\
**Post date:** [May 23, 2016, 7:14pm UTC](https://forum.arduino.cc/t/error-esc-controller-code-errors/387731/3 "2016-05-23T19:14:54Z")

</div>

what should it be?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 23, 2016, 7:58pm UTC](https://forum.arduino.cc/t/error-esc-controller-code-errors/387731/4 "2016-05-23T19:58:13Z")

</div>

> mcles011:  
> what should it be?

Not cross-posted

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 5:52pm UTC](https://forum.arduino.cc/t/error-esc-controller-code-errors/387731/5 "2021-05-05T17:52:14Z")

</div>

Closed on May 5, 2021, 5:52pm UTC


