I completed the assembly for the Blinking LED tutorial, and got to the step where it asks to compile the program. I've opened the INO file in notepad, but I do not know what the method is for compiling the program. The code matches the verbiage in the instructions. If someone knows the steps to accomplish this, it would be appreciated. Thanks.
Have you downloaded and installed the Arduino IDE ?
Which step where? Post a link to your learning materials that have you copying code, but fail to provide instructions for compiling.
Imma guess you skipped a step,or two or three that were in there, otherwise that's a lame tutorial.
a7
Yes, I have, I've entered the code in the field, selected the board, and tried to upload. It came back with this error message:
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino: In function 'void setup()':
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:2:3: error: expected primary-expression before '/' token
/{
^
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:2:4: error: expected primary-expression before '{' token
/{
^
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:6:1: error: a function-definition is not allowed here before '{' token
{
^
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:11:4: error: 'put' was not declared in this scope
} put your setup code here, to run once:
^~~
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:11:4: note: suggested alternative: 'puts'
} put your setup code here, to run once:
^~~
puts
exit status 1
Compilation error: expected primary-expression before '/' token
Post the code that you are trying to compile
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help
Yes, it just says to compile. Looks like it is assuming I already know how that is done. I posted the error message I received.
Thanks
Ok, thank you. I posted the error message in this thread that I received when I tried to upload the code to the board.
And we're all still waiting for you to show us the code. Like this:
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
You did not clear/cut the Minimal Sketch in the IDE window before pasting the BLINK.INO sketch.
Here is the code:
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino: In function 'void setup()':
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:2:3: error: expected primary-expression before '/' token
/{
^
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:2:4: error: expected primary-expression before '{' token
/{
^
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:6:1: error: a function-definition is not allowed here before '{' token
{
^
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:11:4: error: 'put' was not declared in this scope
} put your setup code here, to run once:
^~~
C:\Users\Owner\AppData\Local\Temp.arduinoIDE-unsaved2024524-27236-wdkl2c.i7foh\sketch_jun24a\sketch_jun24a.ino:11:4: note: suggested alternative: 'puts'
} put your setup code here, to run once:
^~~
puts
exit status 1
Compilation error: expected primary-expression before '/' token
Ok, thanks.
No. That is the error
Read post #8 and follow the instructions on posting code
/***********************************************************
File name: 01_blinkingLed.ino
Description: Lit LED, let LED blinks.
Support:shirleyhuang2635@163.com
Website:https://ardest.com
***********************************************************/
int ledPin=8; //definition digital 8 pins as pin to control the LED
void setup()
{
pinMode(ledPin,OUTPUT); //Set the digital 8 port mode, OUTPUT: Output mode
}
void loop()
{
digitalWrite(ledPin,HIGH); //HIGH is set to about 5V PIN8
delay(1000); //Set the delay time, 1000 = 1S
digitalWrite(ledPin,LOW); //LOW is set to about 5V PIN8
delay(1000); //Set the delay time, 1000 = 1S
}
The IDE has Examples already loaded just for the version IDE you have. You don't have to type a thing or use Notepad.
Is the sketch you want one of those?
In the IDE upper left, click File->Examples->01 Basics->Blink.
That code compiles cleanly. Here it is, properly formatted with the <CODE/>
tool.
/***********************************************************
File name: 01_blinkingLed.ino
Description: Lit LED, let LED blinks.
Support:shirleyhuang2635@163.com
Website:https://ardest.com
***********************************************************/
int ledPin = 8; //definition digital 8 pins as pin to control the LED
void setup() {
pinMode(ledPin, OUTPUT); //Set the digital 8 port mode, OUTPUT: Output mode
}
void loop() {
digitalWrite(ledPin, HIGH); //HIGH is set to about 5V PIN8
delay(1000); //Set the delay time, 1000 = 1S
digitalWrite(ledPin, LOW); //LOW is set to about 5V PIN8
delay(1000); //Set the delay time, 1000 = 1S
}
Results of compile
arduino-cli compile -b arduino:avr:uno --warnings all --output-dir ~/tmp --no-color (in directory: /home/me/Documents/sketchbook/Uno_R3/test)
Sketch uses 936 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
Used platform Version Path
arduino:avr 1.8.3 /home/me/.arduino15/packages/arduino/hardware/avr/1.8.3
Compilation finished successfully.
Please post the code that produces the error you are seeing.
That compiles OK for me
Have you by any chance got more than one tab open in the IDE ?
I am disappointed that you chose not to use code tabs when you posted the sketch to make it easier to copy for examination. Please use code tags in future
void setup() {
/{
pinMode(ledPin,OUTPUT); //Set the digital 8 port mode, OUTPUT: Output mode
}
void loop()
{
digitalWrite(ledPin,HIGH); //HIGH is set to about 5V PIN8
delay(1000); //Set the delay time, 1000 = 1S
digitalWrite(ledPin,LOW); //LOW is set to about 5V PIN8
delay(1000); //Set the delay time, 1000 = 1S
} put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Which version of the code are you trying to compile ?
No code tags again, I see