I’m fairly new to Atom / PlatformIO and tried using it for development with Arduino as an alternative to Arduino IDE.
~The Specs~
base code used: Arduino ESP sample code "WifiBlueToothSwitch.ino"
Board: ESP-WROOM-32
Additional Components: 1602A (2x16) LCD
I’ve successfully run other sample code on the ESP module through PlatformIO prior to attempting to use the LCD screen, however when I did attempt to include the LiquidCrystal.h library, it gives me a build error:
srcmain.cpp:22:27: fatal error: LiquidCrystal.h: No such file or directory
compilation terminated.
*** [.pioenvsesp32devsrcmain.o] Error 1
[ERROR] Took 3.34 seconds
So of several of the sites I’ve searched about this issue so far, most point to the missing addition of the «wire.h» header file, however even after including it into the program, it still gives me this error.
My includes are as follows:
#include <Arduino.h>
#include <WiFi.h>
#include <Wire.h>
#include <LiquidCrystal.h>
So I’m not entirely sure why this problem is occurring.
How can I resolve this issue?
Edit 1:
I came across another site a moment ago that suggested attempting an update of PlatformIO via console, however this was to no avail. Everything was marked as «Up-to-date».
DocumentsPlatformIOProjects171031-143050-esp32dev> platformio update
Updating tool-scons @ 3.20501.2 [Up-to-date]
Updating tool-unity @ 1.20302.1 [Up-to-date]
Updating pysite-pioplus @ 0.4.2 [Up-to-date]
Updating contrib-piohome @ 0.3.1 [Up-to-date]
Updating tool-pioplus @ 0.10.11 [Up-to-date]
Platform Manager
================
Platform Espressif 32
--------
Updating espressif32 @ 0.10.0 [Up-to-date]
Updating tool-esptoolpy @ 1.20000.0 [Up-to-date]
Updating toolchain-xtensa32 @ 1.50200.0 [Up-to-date]
Updating framework-arduinoespressif32 @ 1.2.0 [Up-to-date]
Updating tool-espotapy @ 1.0.0 [Up-to-date]
Library Manager
===============
DocumentsPlatformIOProjects171031-143050-esp32dev>
Edit 2:
I have compiled and run this code through the Arduino IDE and can confirm that it works, so the problem seems to be with the PlatformIO IDE…
Edit 3:
After following BMelis’s suggestion, I looked into the PlatformIO.ini file, and added the following line to it:
lib_extra_dirs = C:Program Files (x86)Arduinohardwareespressifesp32libraries
This fixed the initial error for the LiquidCrystal.h, However this also produced the following dependency error during build:
[11/06/17 08:52:58] Processing esp32dev (platform: espressif32; lib_extra_dirs: C:Program Files (x86)Arduinohardwareespressifesp32libraries; board: esp32dev; framework: arduino)
Verbose mode can be enabled via `-v, --verbose` option
Collected 49 compatible libraries
Looking for dependencies...
Library Dependency Graph
|-- <WiFi> v1.0
|-- <Wire> v1.0
|-- <LiquidCrystal> v1.0.7
Compiling .pioenvsesp32devlibWiFiWiFiAP.o
Compiling .pioenvsesp32devlibWiFiWiFiGeneric.o
Compiling .pioenvsesp32devlibWiFiWiFiMulti.o
Compiling .pioenvsesp32devlibWiFiWiFiSTA.o
****ERROR OCCURRED****
C:Program Files (x86)Arduinohardwareespressifesp32librariesWiFisrcWiFiAP.cpp:40:37: fatal error: apps/dhcpserver_options.h: No such file or directory
compilation terminated.
*** [.pioenvsesp32devlibWiFiWiFiAP.o] Error 1
[ERROR] Took 8.13 seconds
I tried adding the directory that it was mentioning by adding a second lib_extra_dirs command in the ini file:
lib_extra_dirs = C:Program Files (x86)Arduinohardwareespressifesp32toolssdkincludelwipapps
However this did nothing to resolve the issue. I am at a loss as to what to do now…
FULL CODE:
#include <Arduino.h>
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Sketch shows how to switch between WiFi and BlueTooth or use both
// Button is attached between GPIO 0 and GND and modes are switched with each press
#include <WiFi.h>
#include <Wire.h>
#include <LiquidCrystal.h>
#define STA_SSID "HIDDEN FOR SECURITY"
#define STA_PASS "HIDDEN FOR SECURITY"
#define AP_SSID "esp32 @ my desk"
#define LED_PIN 5
//LCD variables on analog inputs, but used as digital I/O
//lcd_gnd = gnd
//lcd_vcc = +5v
//lcd_v0 = +5v & pot
const int lcd_rs = 27;
//lcd_rw = gnd
const int lcd_e = 14;
//lcd_d0 = n/a
//lcd_d1 = n/a
//lcd_d2 = n/a
//lcd_d3 = n/a
const int lcd_d4 = 32;
const int lcd_d5 = 33;
const int lcd_d6 = 25;
const int lcd_d7 = 26;
//lcd_bl1 = +5v
//lcd_bl2 = gnd
LiquidCrystal lcd(lcd_rs, lcd_e, lcd_d4, lcd_d5, lcd_d6, lcd_d7);
enum { STEP_BTON, STEP_BTOFF, STEP_STA, STEP_AP, STEP_AP_STA, STEP_OFF, STEP_BT_STA, STEP_END };
void onButton(){
static uint32_t step = STEP_BTON;
switch(step){
case STEP_BTON://BT Only
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Starting BT");
btStart();
break;
case STEP_BTOFF://All Off
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Stopping BT");
btStop();
break;
case STEP_STA://STA Only
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Starting STA");
WiFi.begin(STA_SSID, STA_PASS);
break;
case STEP_AP://AP Only
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Stopping STA");
WiFi.mode(WIFI_AP);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Starting AP");
WiFi.softAP(AP_SSID);
break;
case STEP_AP_STA://AP+STA
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Starting STA");
WiFi.begin(STA_SSID, STA_PASS);
break;
case STEP_OFF://All Off
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Stopping WiFi");
WiFi.mode(WIFI_OFF);
break;
case STEP_BT_STA://BT+STA
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Starting STA+BT");
WiFi.begin(STA_SSID, STA_PASS);
btStart();
break;
case STEP_END://All Off
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Stopping WiFi+BT");
WiFi.mode(WIFI_OFF);
btStop();
break;
default:
break;
}
if(step == STEP_END){
step = STEP_BTON;
} else {
step++;
}
//little debounce
delay(100);
}
void WiFiEvent(WiFiEvent_t event){
switch(event) {
case SYSTEM_EVENT_AP_START:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("AP Started");
Serial.print("AP Started");
WiFi.softAPsetHostname(AP_SSID);
break;
case SYSTEM_EVENT_AP_STOP:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("AP Stopped");
Serial.print("AP Stopped");
break;
case SYSTEM_EVENT_STA_START:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("STA Started");
Serial.print("STA Started");
WiFi.setHostname(AP_SSID);
break;
case SYSTEM_EVENT_STA_CONNECTED:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("STA Connected");
Serial.print("STA Connected");
WiFi.enableIpV6();
break;
case SYSTEM_EVENT_AP_STA_GOT_IP6:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("STA IPv6: ");
Serial.print("STA IPv6: ");
Serial.println(WiFi.localIPv6());
break;
case SYSTEM_EVENT_STA_GOT_IP:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("STA IPv4: ");
Serial.print("STA IPv4: ");
lcd.setCursor(0,1);
lcd.print(WiFi.localIP());
Serial.print(WiFi.localIP());
break;
case SYSTEM_EVENT_STA_DISCONNECTED:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("STA Disconnected");
Serial.print("STA Disconnected");
break;
case SYSTEM_EVENT_STA_STOP:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("STA Stopped");
Serial.print("STA Stopped");
break;
default:
break;
}
}
void setup() {
lcd.begin(16, 2); //tells arduino that the LCD is a 16x2 size LCD
lcd.clear(); //clear any previous text
lcd.setCursor(0, 0); // set cursor to column 0 of row 0 (first row, first block)
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW); // LED off
Serial.begin(115200);
pinMode(0, INPUT_PULLUP);
WiFi.onEvent(WiFiEvent);
Serial.print("ESP32 SDK: ");
Serial.println(ESP.getSdkVersion());
Serial.println("Press the button to select the next mode");
lcd.setCursor(0, 0);
lcd.println("Press mode btn");
}
void loop() {
digitalWrite(LED_PIN, HIGH); // Turn on LED
static uint8_t lastPinState = 1;
uint8_t pinState = digitalRead(0);
if(!pinState && lastPinState){
onButton();
}
lastPinState = pinState;
}
It’s 11 PM on a Wednesday. You’ve just spent three hours toiling on your next Arduino project, and FINALLY, you’re ready to give your sketch a whirl. You hit upload, palms sweaty with anticipation to see all your hard work come to fruition. It’s then you see the error:
No such file or directory.
Surely this is a chance aberration. “Nothing to worry about,” you mutter, sleep-starved and semi-delirious as you hit upload again. And once more, those maddening words, “no such file or directory,” stare back at you in hostile gaslighting mockery.
Have you been here?
If you’re trying to run an Arduino sketch but keep coming across the “no such file or directory” error, don’t worry. This is actually a pretty common problem, and there are two easy fixes that almost always work.
Keep on reading. We’ll show you what they are.
No such file error!
Error messages can be such a pain. They do, however, serve a useful purpose by telling us something about what went wrong. At first glance, the no such file or directory error is particularly maddening because it seems to break that useful purpose rule. Of course there’s a file or directory! You just made the thing, and it’s right there, tucked inside a directory.
But hold up, let’s take a closer look. If you look at the bottom portion of the Arduino IDE where the error message shows up, there’s this handy little button that says “copy error messages.”
Click on that now. You probably won’t fall off your chair to learn that by clicking that button, you just copied the error message from the little window at the bottom of The Serial Monitor’s UI to the clipboard of your computer.
This copy feature is ridiculously useful. You could, for example, paste the error message into Google and learn more about the error. Or you could take advantage of the active Arduino community by asking for help in a forum. For this situation, however, we can be a bit more basic. All we’re going to do is take a closer look at what the message is actually saying. To do that, just fire up your PC’s text editor and paste it into the blank screen.
Decoding the no such file error
Here it is, that pesky error in all its freshly pasted glory.
I’ll break it down for you line by line.
- The first line is easy. It’s just describing the Arduino version in use, what operating system is running, and which board you have selected.
- Line 2 begins to zero in on the problem.
- The first bit, “knob,” is referring to the name of the program. This is your sketch, basically.
- The second bit is what usually begins to confuse people, but it’s easy once you know. The “10” in this example is telling you the error occurred on line 10 of your sketch. The “19” is telling you the length of the line of code in spaces and characters. The first number is usually the more helpful of the two because you can use it to locate the error in your sketch.
- Then we get to the smoking gun of the error. It says, “servo.h: No such file or directory”.
So this thing, “Servo.h.” That’s the thing we need to fix, and thanks to line 2, we know where to find it. Line 10. It’s always line 10.
Now that we know what’s going on a bit better, let’s get down to the business of implementing a fix.
The error of our ways
Let’s lay down some scrutiny on this accursed line 10.
It says “#include <servo.h>”
When we verify this code, this line is telling the Arduino IDE compiler, “Hey, for this program to work, you need to go get this file called servo.h”.
Let’s say you had a label-making machine, and you wanted to use it to print some cool motivational labels, like “Success!” and “Keep Trying!” and “Look, Nachos!” To make that happen, you’ll first have to load in a roll of labels. No roll of labels? Well, then the label maker isn’t gonna work.
The sketch you’re trying to upload is like the label maker. The file (in our example, the file named “servo.h”) is the roll of labels.
So the error message actually is saying something useful. It’s saying, “Hey programmer, you said I needed this other file. Well, I looked for it and it’s not there. What gives?”
Now we know the error message isn’t complete gibberish, let’s look at the two most common scenarios that cause it.
Scenario 1 – Fat fingers
This sketch is one that you’ve written. You’re actually the one who wrote the “#include” line. The first thing you should check is your spelling and capitalization. Maybe you spelled the name of the library incorrectly? Or (as with the example below) perhaps you capitalized the wrong letters.
So “servo.h” should actually have a capital “S.” In full and with correct capitalization, it should read, “Servo.h.” You’ll notice above that the word servo changes color when it’s correctly capitalized. That color change signifies that the library name “Servo” is recognized as a “keyword” in the Arduino IDE.
Keep in mind that might not be the case for all the libraries you’re using. In other words, the color change won’t always indicate you’re using the right spelling or capitalization, but it’s often a helpful visual reminder.
Oh, and it’s probably good to mention that everyone in the history of Arduino programming has misspelled or incorrectly capitalized a word at some point. It’s amazing how long you can stare at a line of code and miss something like that.
So don’t sweat it.
Scenario 2 – Missing files
This brings us to the next common scenario for the “no such file or directory” error.
So often, working with Arduinos involves taking code that someone else has developed and shared online and then tailoring it to your project. That’s part of what makes it so easy to get stuff done with Arduino. One problem that frequently happens when we do that, however, is we accidentally introduce code without a matching file.
An easy way to check to see if you have the file a sketch is looking for is to navigate to Sketch > Include Library from within the Arduino IDE. Then look for the name of that library.
Whatever library the #include statement was calling for, you want to look through this big long list for a library with the exact same name. If you don’t see the file name there, this means the library isn’t installed. You’ll have to add that library before the sketch will compile without errors.
So, how do you add that library?
The easiest way is to go to Sketch > Include Library > Manage Libraries. The Arduino IDE will open up a dialogue box from which you can search for the library you need.
Make sure you type the exact word that matches the #include line. Once you find the missing library, go ahead and click Install. The Arduino IDE will let you know that it’s installing the library you requested and updating the software accordingly.
Next, just double-check that the library has been successfully installed by going to Sketch > Include Library. You should see your new library in the dropdown list.
Good news! If the library is there, you should now be able to compile your sketch error-free.
Other library locations
OK, there’s one little fly in the ointment. How do these dang ointment flies always manage to complicate things so?
Here’s the thing. Not all libraries live in this convenient pop-up window inside the Arduino IDE. The Arduino community is bubbling with clever ideas, but cleverness (unlike processed cheese) doesn’t always come in conveniently standardized, individually wrapped slices. There are tons of different ways to find Arduino libraries on the web.
If you’re downloading or copying a program from the internet, just go to the page where you got that program and take a close look at the library the author is referencing. They may, for example, have a link to GitHub, which is a place where people keep a lot of code libraries.
Wherever you find it, usually the library will be included in a .zip file package. Once you’ve downloaded the .zip file, fire up the Arduino IDE and go to Sketch > Include Library > Add .ZIP library. Then navigate to the location you downloaded the file and select it. Assuming no additional ointment flies invade your workflow, the Arduino IDE will pop up the message “Library added to your libraries” just above the dark area where the original “no such file or directory” error appeared.
Now it’s business as usual! Just go to Sketch > Include Library, and the new library will appear in the drop-down list.
As the dyslexic Frenchman once said to the oversized violinist: “Viola!”
You now know not one but two ways to add a new library. What a time to be alive!
Review
A quick recap, then.
We’ve looked at the two main scenarios that cause the “no such file or directory” error to appear after you compile your sketch:
- The fat fingers phenomenon: Check your spelling and capitalization! If you wrote the sketch, there’s a mighty good chance you introduced a tiny error. And don’t beat yourself up over it! Literally every coder has done this.
- The missing files mixup: Failing that, if you copied code from someone else check that you have the correct libraries installed. Don’t see your library? Install it using the method described above, and you should be good to go.
There may be no such thing as a free lunch, a coincidence, or a luck dragon. But rest assured. Your files and directories? They’re alive and well.
I’m trying to start with the SainSmart 4×20 serial LCD, and copied the library to the Arduino library:
So LiquidCrystal_I2C.h is included. But when I try to compile an example sketch it says
Arduino: 1.7.0 (Windows 7), Board: «Arduino Uno»
HelloWorld_i2c.pde:2:31: fatal error: LiquidCrystal_I2C.h: No such file or directory
compilation terminated.
Error compiling.
Any ideas how to fix this?
asked Apr 16, 2015 at 13:40
Joris GroosmanJoris Groosman
1,1713 gold badges10 silver badges25 bronze badges
3
I copied the SainSmart library to the IDE’s library folder, not noticing that there was already a folder named «LiquidCrystal». Apparently the files added to the existing folder are being ignored.
Renaming the SainSmart library before adding it solves the problem.
answered Apr 16, 2015 at 15:07
Joris GroosmanJoris Groosman
1,1713 gold badges10 silver badges25 bronze badges
There is not enough info to give a specific answer so I will give some troubleshooting tips:
- First make sure at the top of your code you have: #include <LiquidCrystal_I2C.h> — with angle brackets
- You may also need the Wire header file: #include <Wire.h> — with angle brackets
- Make sure you Include Serial
- Make sure there are no extra folders in the library for example there should be a folder called liquidcrystal inside the liquidcrystal folder
- If all fails copy the code from the header file make a new file in the IDE paste it in there and call it LiquidCrystal_I2C.h
Hope one of those solves your problem.
answered Apr 16, 2015 at 14:01
Вс, 07/05/2017 — 20:17
#1
T.Rook
Offline
Зарегистрирован: 05.03.2016
полностью скетч и ошибку покажите.
Еще раз проверьте выбор платы и порта в IDE
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 20:31
#2
Jeka_M

Offline
Зарегистрирован: 06.07.2014
Полностью ошибку приведите. Скопируйте сюда текст и вставьте.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 20:35
#3
qwone

Offline
Зарегистрирован: 03.07.2016
Скорее чел ну очень зеленый. У него IDE стоит на UNO , а он пихает Nano.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 20:48
#4
T.Rook
Offline
Зарегистрирован: 05.03.2016
Кажется, это была агония. Предлагаю консилиум на этом закрыть. Расходимся.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 20:54
#5
meganom
Offline
Зарегистрирован: 07.05.2017
Скетч для проверки I2C переходника для LCD 16×2
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
// initialize the LCD
lcd.begin();
// Turn on the blacklight and print a message.
lcd.backlight();
lcd.print(«Hello, world!»);
}
void loop()
{
// Do nothing here…
}
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 20:58
#6
andriano

Offline
Зарегистрирован: 20.06.2015
meganom, первопричина Ваших проблем в том, что Вы читать очень не любите.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:01
#7
meganom
Offline
Зарегистрирован: 07.05.2017
Arduino: 1.8.2 (Windows 8.1), Плата:»Arduino Nano, ATmega328″
D:ArduinoArduino-LiquidCrystal-I2C-libraryArduino-LiquidCrystal-I2C-library-masterexamplesHelloWorldHelloWorld.ino:4:31: fatal error: LiquidCrystal_I2C.h: No such file or directory
#include <LiquidCrystal_I2C.h>
^
compilation terminated.
exit status 1
Ошибка компиляции для платы Arduino Nano.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:04
#8
T.Rook
Offline
Зарегистрирован: 05.03.2016
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:06
#9
meganom
Offline
Зарегистрирован: 07.05.2017
да установил
Arduino: 1.8.2 (Windows 8.1), Плата:»Arduino Nano, ATmega328″
Изменены опции сборки, пересобираем все
D:ArduinoArduino-LiquidCrystal-I2C-libraryArduino-LiquidCrystal-I2C-library-masterexamplesHelloWorldHelloWorld.ino:4:31: fatal error: LiquidCrystal_I2C.h: No such file or directory
#include <LiquidCrystal_I2C.h>
^
compilation terminated.
Несколько библиотек найдено для «LiquidCrystal.h»
Используется: C:UsersихихиихDocumentsArduinolibrariesLiquidCrystal
Не используется: D:Program Files (x86)ArduinolibrariesLiquidCrystal
exit status 1
Ошибка компиляции для платы Arduino Nano.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:09
#10
meganom
Offline
Зарегистрирован: 07.05.2017
может я что то не так устанавливаю , мне после работы с мк на си. тяжело понять структуру скетча , я думал, загрузил скетч и используй , я так понял нужно подключать еще библиотеки , но как правильно это сделать я не пойму
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:09
#11
T.Rook
Offline
Зарегистрирован: 05.03.2016
meganom пишет:
да установил
Arduino: 1.8.2 (Windows 8.1), Плата:»Arduino Nano, ATmega328″
Изменены опции сборки, пересобираем все
D:ArduinoArduino-LiquidCrystal-I2C-libraryArduino-LiquidCrystal-I2C-library-masterexamplesHelloWorldHelloWorld.ino:4:31: fatal error: LiquidCrystal_I2C.h: No such file or directory
#include <LiquidCrystal_I2C.h>
^
compilation terminated.
Несколько библиотек найдено для «LiquidCrystal.h»
Используется: C:UsersихихиихDocumentsArduinolibrariesLiquidCrystal
Не используется: D:Program Files (x86)ArduinolibrariesLiquidCrystal
exit status 1
Ошибка компиляции для платы Arduino Nano.
Давайте удалим все тут: C:UsersихихиихDocumentsArduinolibrariesLiquidCrystal
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:10
#12
meganom
Offline
Зарегистрирован: 07.05.2017
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:10
#13
T.Rook
Offline
Зарегистрирован: 05.03.2016
meganom пишет:
может я что то не так устанавливаю , мне после работы с мк на си. тяжело понять структуру скетча , я думал, загрузил скетч и используй , я так понял нужно подключать еще библиотеки , но как правильно это сделать я не пойму
Начальные знания тут: Среда разработки
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:11
#14
andriano

Offline
Зарегистрирован: 20.06.2015
meganom, установить нужно только одну. Это не тот случай, когда чем больше, тем лучше.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:37
#15
meganom
Offline
Зарегистрирован: 07.05.2017
И так, я скачал скетч, открываю его. Вижу что в начале есть подключение двух библиотек
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Wire.h почему-то написана красным шрифтом а LiquidCrystal_I2C.h черным , что это значит я не понял, но скорей всего это значит что одна библиотека подключена а вторая нет . Дальше мне последовательность действий не понятна. Как правильно подключить библиотеку LiquidCrystal_I2C.h и Wire.h ? Я так понимаю, что они должны находится в папке library среды ардуино , и при начале компиляции проекта среда лезет в эту папку и подтягивает эти библиотеки если их нет то выдаёт ошибку .Мне не понятно где брать недостающую библиотеку и как правильно ее подключить к проекту .По идеи недостающая библиотека есть в папке с скетчем который я скачал . а проектах ардуино есть только два типа файлов , сам скетч и .h файл ? Сколько типов файлов нужно подключать к проекту ?
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:47
#16
Клапауций 112

Offline
Зарегистрирован: 01.03.2017
meganom пишет:
И так, я скачал скетч…
вот на этом месте закрывай этот форум и трахай мосг автору скетча.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:51
#17
toc
Offline
Зарегистрирован: 09.02.2013
>> Пару дней как пользуюсь платкой arduino nano.
>> Какой скетч не возьму , везде пишет- Ошибка компиляции для платы Arduino Nano.
meganom, дайте результат компиляции скетча Blink
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 21:54
#18
T.Rook
Offline
Зарегистрирован: 05.03.2016
meganom пишет:
Сколько типов файлов нужно подключать к проекту ?
Если коротко, то библиотека: h — заголовочный файл (обычно указывают в include), cpp — реализация.
По include и другие конструкции языка таки следует почитать.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 22:10
#19
meganom
Offline
Зарегистрирован: 07.05.2017
T.Rook пишет:
meganom пишет:
Сколько типов файлов нужно подключать к проекту ?
Если коротко, то библиотека: h — заголовочный файл (обычно указывают в include), cpp — реализация.
По include и другие конструкции языка таки следует почитать.
Это я все знаю . Объясните мне, куда положить или как подключить эти библиотеки если они у меня есть
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 22:17
#20
meganom
Offline
Зарегистрирован: 07.05.2017
подключил библиотеку .выпало еще больше ошибок
Arduino: 1.8.2 (Windows 8.1), Плата:»Arduino Nano, ATmega328″
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::getBacklight()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::expanderWrite(unsigned char)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::noBacklight()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::backlight()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::pulseEnable(unsigned char)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::write4bits(unsigned char)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::send(unsigned char, unsigned char)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::clear()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::home()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::setCursor(unsigned char, unsigned char)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::noDisplay()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::display()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::noCursor()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::cursor()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::noBlink()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::blink()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::scrollDisplayLeft()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::scrollDisplayRight()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::leftToRight()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::rightToLeft()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::autoscroll()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::noAutoscroll()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::createChar(unsigned char, unsigned char*)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::begin()’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::load_custom_character(unsigned char, unsigned char*)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::setBacklight(unsigned char)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
librariesArduino-LiquidCrystal-I2C-library-masterLiquidCrystal_I2C.cpp.o (symbol from plugin): In function `LiquidCrystal_I2C::LiquidCrystal_I2C(unsigned char, unsigned char, unsigned char, unsigned char)’:
(.text+0x0): multiple definition of `LiquidCrystal_I2C::printstr(char const*)’
sketchLiquidCrystal_I2C.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Ошибка компиляции для платы Arduino Nano.
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
«Показать подробный вывод во время компиляции»
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 22:27
#21
T.Rook
Offline
Зарегистрирован: 05.03.2016
meganom пишет:
T.Rook пишет:
meganom пишет:
Сколько типов файлов нужно подключать к проекту ?
Если коротко, то библиотека: h — заголовочный файл (обычно указывают в include), cpp — реализация.
По include и другие конструкции языка таки следует почитать.
Это я все знаю . Объясните мне, куда положить или как подключить эти библиотеки если они у меня есть
1. в каталог libraries. Распаковать в каталог и этого достаточно.
2. Давать кучу ошибок без скеча — подумай, как люди у которых ты спрашиваешь будут анализировать и что?
3. По поводу «collect2.exe: error: ld returned 1 exit status» — недавно на форуме было, поищите.
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 22:29
#22
meganom
Offline
Зарегистрирован: 07.05.2017
T.Rook пишет:
meganom пишет:
T.Rook пишет:
meganom пишет:
Сколько типов файлов нужно подключать к проекту ?
Если коротко, то библиотека: h — заголовочный файл (обычно указывают в include), cpp — реализация.
По include и другие конструкции языка таки следует почитать.
Это я все знаю . Объясните мне, куда положить или как подключить эти библиотеки если они у меня есть
1. в каталог libraries. Распаковать в каталог и этого достаточно.
2. Давать кучу ошибок без скеча — подумай, как люди у которых ты спрашиваешь будут анализировать и что?
1 Где это каталог находится?
2 В каком виде нужен скетч? Тут можно прикреплять файлы?
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 22:30
#23
ua6em

Онлайн
Зарегистрирован: 17.08.2016
ТС точно не читатель, ТС писатель
- Войдите на сайт для отправки комментариев
Вс, 07/05/2017 — 22:35
#24
T.Rook
Offline
Зарегистрирован: 05.03.2016
- Войдите на сайт для отправки комментариев
Чт, 25/05/2017 — 18:50
#25
FrostDad
Offline
Зарегистрирован: 25.05.2017
Здраствуйте, у меня анологичная проблема.
скетч: /* Данный скетч делает следующее: передатчик (TX) отправляет массив
* данных, который генерируется согласно показаниям с кнопки и с
* двух потенциомтеров. Приёмник (RX) получает массив, и записывает
* данные на реле, сервомашинку и генерирует ШИМ сигнал на транзистор.
by AlexGyver 2016
*/
#include <SPI.h>
#include «nRF24L01.h»
#include «RF24.h»
RF24 radio(9,10); // «создать» модуль на пинах 9 и 10 Для Уно
//RF24 radio(9,53); // для Меги
byte address[][6] = {«1Node»,»2Node»,»3Node»,»4Node»,»5Node»,»6Node»}; //возможные номера труб
void setup(){
Serial.begin(9600); //открываем порт для связи с ПК
radio.begin(); //активировать модуль
radio.setAutoAck(1); //режим подтверждения приёма, 1 вкл 0 выкл
radio.setRetries(0,15); //(время между попыткой достучаться, число попыток)
radio.enableAckPayload(); //разрешить отсылку данных в ответ на входящий сигнал
radio.setPayloadSize(32); //размер пакета, в байтах
radio.openReadingPipe(1,address[0]); //хотим слушать трубу 0
radio.setChannel(0x60); //выбираем канал (в котором нет шумов!)
radio.setPALevel (RF24_PA_MAX); //уровень мощности передатчика. На выбор RF24_PA_MIN, RF24_PA_LOW, RF24_PA_HIGH, RF24_PA_MAX
radio.setDataRate (RF24_250KBPS); //скорость обмена. На выбор RF24_2MBPS, RF24_1MBPS, RF24_250KBPS
//должна быть одинакова на приёмнике и передатчике!
//при самой низкой скорости имеем самую высокую чувствительность и дальность!!
radio.powerUp(); //начать работу
radio.startListening(); //начинаем слушать эфир, мы приёмный модуль
}
void loop() {
byte pipeNo, gotByte;
while( radio.available(&pipeNo)){ // слушаем эфир со всех труб
radio.read( &gotByte, sizeof(gotByte) ); // чиатем входящий сигнал
Serial.print(«Recieved: «); Serial.println(gotByte);
}
}
ошибка:Arduino: 1.8.2 (Windows 7), Плата:»Arduino Nano, ATmega328″
C:ДаняардуиносчетчискечиNRF24L01sketch_may25aNRF24L01sketch_may25a.ino:9:22: fatal error: nRF24L01.h: No such file or directory
compilation terminated.
exit status 1
Ошибка компиляции для платы Arduino Nano.
Прочитав данную тему, так и не разобрался в чем дело,прошу помощи.
- Войдите на сайт для отправки комментариев
Чт, 25/05/2017 — 19:15
#26
Jeka_M

Offline
Зарегистрирован: 06.07.2014
- Войдите на сайт для отправки комментариев
Чт, 25/05/2017 — 19:20
#27
qwone

Offline
Зарегистрирован: 03.07.2016
(анекдот) Сотый раз Чунгачгук наступал на грабли и не мог никак понять, что же бъет его по лбу. Надо открыть тему на каком нибудь форуме. Но решить на каком форуме открыть эту тему Чунгачгук не смог. Наверно надо на форуме "Охота и рыбалка". Ведь Чунгачгук счил себя опытным охотником, а не каким-то садоводом.
- Войдите на сайт для отправки комментариев
Сб, 27/05/2017 — 15:58
#28
vovan_UA
Offline
Зарегистрирован: 27.05.2017
A у меня вот такую ошибку выдает после попытки залития скеча через XLoader то что ниже ошибка в адруино ид при том что не имеет значения что закидывать сразу вопрос можно ли это вылечить как то как я вижу это ошибка при проверке
Скетч использует 21464 байт (69%) памяти устройства. Всего доступно 30720 байт.
Глобальные переменные используют 977 байт (47%) динамической памяти, оставляя 1071 байт для локальных переменных. Максимум: 2048 байт.
avrdude: verification error, first mismatch at byte 0x0042
0xf1 != 0x1d
avrdude: verification error; content mismatch
avrdude: verification error; content mismatch
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 13:56
#29
DAFdriver
Offline
Зарегистрирован: 12.08.2016
В ардуино я новичек . Появился форум (понарамный ксв-метр) . Решил собрать. И сразу проблемка — неполучается прошить arduino nano .
Там несколько скетчей и ни один не мгу залить , другие библиотеки (примеры)грузятся и работают. Помогите плиз .
Вот скетч :
/***************************************************************************
* Name : DDS_Sweeper.BAS *
* Author : Beric Dunn (K6BEZ) *
* Notice : Copyright (c) 2013 CC-BY-SA *
* : Creative Commons Attribution-ShareAlike 3.0 Unported License *
* Date : 9/26/2013 *
* Version : 1.0 *
* Notes : Written using for the Arduino Micro *
* : Pins: *
* : A0 — Reverse Detector Analog in *
* : A1 — Forward Detector Analog in *
* : Modified by Norbert Redeker (DG7EAO) 07/2014 *
* : TFT Display mit ILI9341 Chip, SPI, 240 x 320 *
***************************************************************************/
#include <SPI.h>
#include «Ucglib.h»
#include «rusFont.h»
// Define Pins used to control AD9850 DDS
const int FQ_UD=11;
const int SDAT=10;
const int SCLK=12;
const int RESET=9;
// Variablen für Display
double vswrArray[110]; //Array für SWR
int z = 0; // Index für Array
double SwrFreq = 14; // Variable für Freq. mit SWR Min.
double SwrMin = 100; // Variable für SWR Min.
double Freq1 = 1; // Freq. Links unterste Zeile Display
double Freq2 = 15; // Freq. Mitte unterste Zeile Display
double Freq3 = 30; // Freq. Mitte unterste Zeile Display
unsigned long milliold = 0; //Millisekunden für Entprellung Interrupt
unsigned long millinew = 0; //Millisekunden für Entprellung Interrupt
int flag = 0; // wir auf 1 gesetzt bei Interrupt, in void Loop perform_sweep
double counter = 0; // Zähler um erste Interrupts zu ignorieren
// Variablen für Messung
double Fstart_MHz = 1; // Start Frequency for sweep
double Fstop_MHz = 30; // Stop Frequency for sweep
double current_freq_MHz; // Temp variable used during sweep
long serial_input_number; // Used to build number from serial stream
int num_steps = 100; // Number of steps to use in the sweep
char incoming_char; // Character read from serial stream
//Konstruktor für Display
Ucglib_ST7735_18x128x160_SWSPI ucg(/*sclk=*/ 12, /*data=*/ 10, /*cd=*/ 6 , /*cs=*/ 5, /*reset=*/ 4);
// the setup routine runs once when you press reset:
void setup() {
// Voltmetr
analogReference(INTERNAL);
float Vbat = (analogRead(A5) * 1.1) / 1023.0;
float Vin = Vbat / (69.8 / (783.0 + 69.8)); // R2/(R1+R2)
// Schreibe Info Text auf Display
ucg.begin(UCG_FONT_MODE_SOLID);
ucg.clearScreen();
ucg.setRotate90();
ucg.setFont(ucg_font_9x15_tf);
ucg.setColor(255, 255, 255);
ucg.setPrintPos(10,20);
ucg.print(«Arduino Antenna»);
ucg.setPrintPos(25,40);
ucg.print(«SWR Analyzer»);
ucg.setPrintPos(35,60);
ucg.print(«1-30 MHz»);
ucg.setPrintPos(20,80);
ucg.print(«Komsomolsk 2017»);
ucg.setPrintPos(5,128);
ucg.print(«BAT»);
ucg.setPrintPos(40,128);
ucg.print(Vin, 1);
// Configiure DDS control pins for digital output
pinMode(FQ_UD,OUTPUT);
pinMode(SCLK,OUTPUT);
pinMode(SDAT,OUTPUT);
pinMode(RESET,OUTPUT);
//Tasten Interrupt an PIN 2
pinMode(2,OUTPUT);
digitalWrite(2, HIGH);
attachInterrupt(0, key2, FALLING);
unsigned long milliold = millis();
//Tasten Interrupt an PIN 3
pinMode(3,OUTPUT);
digitalWrite(3, HIGH);
attachInterrupt(1, key3, FALLING);
//milliold = millis();
// Configure LED pin for digital output
pinMode(13,OUTPUT);
// Set up analog inputs on A0 and A1, internal reference voltage
pinMode(A0,INPUT);
pinMode(A1,INPUT);
analogReference(INTERNAL);
// initialize serial communication at 57600 baud
Serial.begin(57600);
// Reset the DDS
digitalWrite(RESET,HIGH);
digitalWrite(RESET,LOW);
//Initialise the incoming serial number to zero
serial_input_number=0;
}
// the loop routine runs over and over again forever:
void loop() {
//Check for character
if(Serial.available()>0){
incoming_char = Serial.read();
switch(incoming_char){
case ‘0’:
case ‘1’:
case ‘2’:
case ‘3’:
case ‘4’:
case ‘5’:
case ‘6’:
case ‘7’:
case ‘8’:
case ‘9’:
serial_input_number=serial_input_number*10+(incoming_char-‘0’);
break;
case ‘A’:
//Turn frequency into FStart
Fstart_MHz = ((double)serial_input_number)/1000000;
serial_input_number=0;
break;
case ‘B’:
//Turn frequency into FStop
Fstop_MHz = ((double)serial_input_number)/1000000;
serial_input_number=0;
break;
case ‘C’:
//Turn frequency into FStart and set DDS output to single frequency
Fstart_MHz = ((double)serial_input_number)/1000000;
//SetDDSFreq(Fstart_MHz);
SetDDSFreq(Fstart_MHz * 1000000);
delay(100);
SetDDSFreq(Fstart_MHz * 1000000);
serial_input_number=0;
break;
case ‘N’:
// Set number of steps in the sweep
num_steps = serial_input_number;
serial_input_number=0;
break;
case ‘S’:
case ‘s’:
Perform_sweep();
break;
case ‘?’:
// Report current configuration to PC
Serial.print(«Start Freq:»);
Serial.println(Fstart_MHz*1000000);
Serial.print(«Stop Freq:»);
Serial.println(Fstop_MHz*1000000);
Serial.print(«Num Steps:»);
Serial.println(num_steps);
break;
}
Serial.flush();
}
//Perform Sweep nach Interrupt PIN2 oder 3
// ingnoriere Startup Interrupts durch counter
if (flag == 1 && counter >2)
{
flag = 0;
Perform_sweep();
}
}
void Perform_sweep(){
double FWD=0;
double REV=0;
double VSWR;
double Fstep_MHz = (Fstop_MHz-Fstart_MHz)/num_steps;
z = 0;
SwrMin = 100;
ucg.clearScreen();
ucg.setFont(ucg_font_9x15_tf);
ucg.setColor(255, 0, 100);
ucg.setPrintPos(35,60);
ucg.print(«Analiz KSW»);
// Start loop
for(int i=0;i<=num_steps;i++){
// Calculate current frequency
current_freq_MHz = Fstart_MHz + i*Fstep_MHz;
// Set DDS to current frequency
SetDDSFreq(current_freq_MHz*1000000);
// Wait a little for settling
//delay(10);
delay(100);
// Read the forward and reverse voltages
REV = analogRead(A0);
FWD = analogRead(A1);
//Offset Korrektur
REV = REV-1;
if(REV>=FWD){
REV = FWD-1;
}
if (REV <1) {
REV = 1;
}
VSWR = (FWD+REV)/(FWD-REV);
//Skalieren für Ausgabe
VSWR = VSWR * 1000;
// Send current line back to PC over serial bus
Serial.print(current_freq_MHz*1000000);
Serial.print(«,0,»);
Serial.print(VSWR);
Serial.print(«,»);
Serial.print(FWD);
Serial.print(«,»);
Serial.println(REV);
// Übergebe SWR an Array
// ERmittele Freq bei niedrigsten SWR
vswrArray[z] = VSWR/1000;
if (vswrArray[z] > 10) vswrArray[z] = 10;
if (vswrArray[z] < SwrMin && vswrArray[z] > 1)
{
SwrMin = vswrArray[z];
SwrFreq = current_freq_MHz;
}
z = z + 1;
}
// Send «End» to PC to indicate end of sweep
Serial.println(«End»);
Serial.flush();
ucg.clearScreen();
//Zeichne Grid
CreateGrid();
ucg.setColor(76, 255, 0);
// Draw Line
double last = 10;
double xx = 6;
double j = 1;
for (int i = 1 ;i < 103; i++){
xx = vswrArray[i];
ucg.drawLine(j,105-last*9, j+1, 105-xx*9);
ucg.drawLine(j+1,105-last*9, j+2, 105-xx*9);
j = j + 1.5;
last = xx;
}
}
// Setze DDS Frequenz
void SetDDSFreq(double Freq_Hz){
// Calculate the DDS word — from AD9850 Datasheet
int32_t f = Freq_Hz * 4294967295/125000000;
// Send one byte at a time
for (int b=0;b<4;b++,f>>=8){
send_byte(f & 0xFF);
}
// 5th byte needs to be zeros
send_byte(0);
// Strobe the Update pin to tell DDS to use values
digitalWrite(FQ_UD,HIGH);
digitalWrite(FQ_UD,LOW);
}
// Sende Daten an DDS
void send_byte(byte data_to_send){
// Bit bang the byte over the SPI bus
for (int i=0; i<8; i++,data_to_send>>=1){
// Set Data bit on output pin
digitalWrite(SDAT,data_to_send & 0x01);
// Strobe the clock pin
digitalWrite(SCLK,HIGH);
digitalWrite(SCLK,LOW);
}
}
//Zeichne Grid auf TFT Display
void CreateGrid()
{
//ucg.clearScreen();
double maxSwr = 10;
ucg.setFont(ucg_font_9x15_tf);
ucg.drawHLine(0,60,155);
ucg.drawHLine(0,98,155);
ucg.drawVLine(39,15,90);
ucg.drawVLine(78,15,90);
ucg.drawVLine(117,15,90);
ucg.setPrintPos(0, 118);
ucg.print(Freq1,3);
ucg.setPrintPos(65, 118);
ucg.print(Freq2,3);
ucg.setPrintPos(130, 118);
ucg.print(Freq3,3);
ucg.setPrintPos(1, 11);
ucg.print(«SWR»);
ucg.setPrintPos(30, 11);
ucg.print(SwrMin,2);
ucg.setPrintPos(65, 11);
ucg.print(«>»);
ucg.setPrintPos(75, 11);
ucg.print(maxSwr,2);
ucg.setPrintPos(125, 11);
ucg.print(SwrFreq,3);
ucg.drawRFrame(0,15,155,90, 1);
}
// Interrupt Service Routine
// Abfrage Low an Pin 2
void key2()
{
//ignoriere Startup Interrupts > counter
counter = counter + 1;
//Entprellen mit millis()
millinew = millis();
if (millinew — milliold < 1000)
{
milliold = millinew;
return;
}
milliold = millinew;
Fstart_MHz = 1; // Start Frequency for sweep
Fstop_MHz = 30; // Stop Frequency for sweep
num_steps = 102; // Steps
Freq1 = 1; // Unterste Zeile Display Freq. Links
Freq2 = 15; // Unterste Zeile Display Freq. Mitte
Freq3 = 30; // Unterste Zeile Display Freq. Recht
//Perform_sweep();
flag = 1;
}
// Interrupt Service Routine
// Abfrage Low an Pin 3
void key3()
{
//ignoriere Startup Interrupts > counter
counter = counter + 1;
//Entprellen mit millis()
millinew = millis();
if (millinew — milliold < 1000)
{
milliold = millinew;
return;
}
milliold = millinew;
int x = SwrFreq + 0.5; //Runde auf Mhz
Fstart_MHz = x-1; // Start Frequency for sweep
Fstop_MHz = x+1; // Stop Frequency for sweep
num_steps = 102; // Steps
Freq1 = x-1; // Unterste Zeile Display Freq. Links
Freq2 = x; // Unterste Zeile Display Freq. Mitte
Freq3 = x+1; // Unterste Zeile Display Freq. Rechts
//Perform_sweep();
flag = 1;
}
плюс Русский текст , он в том — же скетче :
const ucg_fntpgm_uint8_t my14x10rus[4157] UCG_SECTION(«.progmem.my14x10») = {
0,11,15,0,255,14,3,35,6,248,32,255,0,15,255,14,
0,0,0,0,8,0,0,2,14,14,4,1,0,64,192,192,
192,192,192,192,192,192,128,0,64,192,128,6,5,5,7,0,
9,68,204,204,204,136,10,14,28,11,0,0,8,128,8,128,
17,0,17,0,127,192,17,0,17,0,34,0,34,0,255,128,
34,0,34,0,68,0,68,0,9,14,28,10,0,0,8,0,
8,0,59,128,123,0,200,0,200,0,232,0,107,0,11,128,
9,128,9,128,111,0,238,0,8,0,8,14,14,9,0,0,
97,179,214,102,12,12,24,24,48,48,102,107,205,134,9,14,
28,10,0,0,56,0,124,0,108,0,108,0,108,0,56,0,
56,128,109,128,199,0,194,0,199,0,237,128,124,128,56,0,
2,5,5,3,0,10,128,192,192,192,64,5,14,14,6,0,
0,24,48,96,96,192,192,192,192,192,192,96,96,48,24,5,
14,14,6,0,0,192,96,48,48,24,24,24,24,24,24,56,
48,96,192,7,7,7,8,0,4,146,214,124,16,124,214,146,
8,10,10,10,0,1,8,24,24,24,127,254,24,24,24,16,
4,6,6,5,0,0,112,96,96,64,192,192,8,2,2,9,
0,5,127,254,3,3,3,4,0,0,224,160,224,8,14,14,
9,0,0,3,3,6,6,12,12,24,24,48,48,96,96,192,
192,9,14,28,10,0,0,62,0,127,0,227,128,197,128,197,
128,197,128,201,128,201,128,209,128,209,128,209,128,227,128,127,
0,62,0,9,14,28,10,0,0,12,0,28,0,60,0,124,
0,8,0,4,0,12,0,12,0,8,0,4,0,12,0,12,
0,127,128,255,128,9,14,28,10,0,0,126,0,255,0,195,
128,193,128,1,128,3,128,63,0,126,0,224,0,192,0,192,
0,192,0,223,128,191,0,9,14,28,10,0,0,126,0,255,
0,195,128,1,128,1,128,3,0,58,0,119,0,3,128,1,
128,1,128,3,128,255,0,126,0,9,14,28,10,0,0,2,
0,6,0,14,0,30,0,62,0,118,0,230,0,198,0,251,
128,247,0,6,0,6,0,6,0,4,0,9,14,28,10,0,
0,127,128,127,128,96,0,96,0,96,0,110,0,111,0,3,
128,1,128,1,128,1,128,195,0,255,0,124,0,9,14,28,
10,0,0,31,0,127,0,96,0,192,0,192,0,192,0,222,
0,223,0,195,128,193,128,193,128,227,0,127,0,60,0,9,
14,28,10,0,0,127,128,255,128,0,0,3,0,3,0,6,
0,6,0,12,0,12,0,24,0,24,0,48,0,48,0,32,
0,9,14,28,10,0,0,58,0,119,0,227,128,193,128,193,
128,99,0,54,0,111,0,227,128,193,128,193,128,227,128,119,
0,46,0,9,14,28,10,0,0,60,0,255,0,231,0,195,
128,193,128,193,128,225,128,253,128,125,128,1,128,3,128,7,
0,127,0,252,0,3,11,11,4,0,2,224,160,224,0,0,
0,0,0,224,160,224,4,13,13,5,0,0,112,80,112,0,
0,0,0,0,112,80,112,96,192,9,11,22,10,0,1,1,
128,3,128,15,0,28,0,120,0,224,0,120,0,28,0,15,
0,3,128,1,128,9,6,12,10,0,4,127,128,255,0,0,
0,0,0,127,128,255,0,9,11,22,10,0,1,192,0,224,
0,120,0,60,0,15,0,3,128,15,0,60,0,120,0,224,
0,192,0,8,14,14,9,0,0,116,238,135,3,3,6,14,
56,48,48,0,0,48,48,9,11,22,10,0,1,62,0,65,
0,128,128,154,128,166,128,162,128,162,128,166,128,155,0,64,
0,63,128,9,14,28,10,0,0,252,0,254,0,199,0,195,
128,193,128,193,128,193,128,253,128,253,128,193,128,193,128,193,
128,193,128,129,0,9,14,28,10,0,0,94,0,223,0,195,
128,193,128,193,128,195,128,255,0,255,0,195,128,193,128,193,
128,195,128,223,0,190,0,9,14,28,10,0,0,14,0,63,
0,115,128,97,128,192,0,192,0,192,0,192,0,192,0,192,
0,96,0,112,0,63,128,15,0,9,14,28,10,0,0,238,
0,111,0,99,128,97,128,97,128,97,128,97,128,97,128,97,
128,97,128,97,128,99,128,111,0,238,0,9,14,28,10,0,
0,95,128,223,0,192,0,192,0,192,0,192,0,223,0,222,
0,192,0,192,0,192,0,192,0,223,128,191,0,9,14,28,
10,0,0,95,128,223,0,192,0,192,0,192,0,192,0,223,
0,222,0,192,0,192,0,192,0,192,0,192,0,128,0,9,
14,28,10,0,0,63,128,127,128,225,128,192,0,192,0,192,
0,192,0,207,128,223,128,193,128,193,128,225,128,127,128,62,
0,9,14,28,10,0,0,129,0,193,128,193,128,193,128,193,
128,193,128,223,128,223,128,193,128,193,128,193,128,193,128,193,
128,64,128,8,14,14,10,1,0,254,127,24,24,24,24,24,
24,24,24,24,24,254,127,9,14,28,10,0,0,31,128,63,
128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,
128,1,128,195,128,255,0,62,0,9,14,28,10,0,0,65,
128,195,128,199,0,206,0,220,0,216,0,216,0,216,0,216,
0,220,0,206,0,199,0,195,128,65,128,9,14,28,10,0,
0,64,0,192,0,192,0,192,0,192,0,192,0,192,0,192,
0,192,0,192,0,192,0,192,0,255,128,255,0,9,14,28,
10,0,0,193,128,227,128,247,128,247,128,213,128,193,128,213,
128,221,128,221,128,201,128,193,128,193,128,193,128,129,0,9,
14,28,10,0,0,225,0,225,128,241,128,241,128,249,128,217,
128,221,128,205,128,205,128,197,128,197,128,193,128,193,128,128,
128,9,14,28,10,0,0,46,0,111,0,227,128,193,128,193,
128,193,128,193,128,193,128,193,128,193,128,193,128,227,128,123,
0,58,0,9,14,28,10,0,0,254,0,255,0,195,128,193,
128,193,128,195,128,223,0,222,0,192,0,192,0,192,0,192,
0,192,0,128,0,10,15,30,10,0,255,46,0,111,0,227,
128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,
128,227,0,123,128,58,192,0,192,9,14,28,10,0,0,126,
0,255,0,195,128,193,128,193,128,195,128,223,0,220,0,206,
0,199,0,195,128,193,128,193,128,129,0,9,14,28,10,0,
0,62,0,127,0,224,0,192,0,192,0,224,0,118,0,27,
0,3,128,1,128,1,128,3,128,255,128,127,0,9,14,28,
10,0,0,255,0,127,128,0,0,12,0,12,0,12,0,12,
0,12,0,12,0,12,0,12,0,12,0,12,0,4,0,9,
14,28,10,0,0,64,128,193,128,193,128,193,128,193,128,193,
128,193,128,193,128,193,128,193,128,193,128,99,0,127,0,62,
0,9,14,28,10,0,0,227,128,99,0,99,0,99,0,34,
0,54,0,54,0,54,0,20,0,28,0,28,0,28,0,8,
0,8,0,10,14,28,11,0,0,64,64,192,192,192,192,192,
192,192,192,192,192,204,192,204,192,204,192,222,192,222,192,211,
192,193,192,128,192,9,14,28,10,0,0,193,128,193,128,193,
128,99,0,99,0,50,0,56,0,28,0,14,0,103,0,99,
0,193,128,193,128,193,128,10,14,28,10,0,0,192,192,192,
192,97,128,97,128,51,0,63,0,30,0,12,0,8,0,4,
0,12,0,12,0,12,0,8,0,9,14,28,10,0,0,127,
128,255,128,1,128,3,128,7,0,6,0,4,0,16,0,48,
0,112,0,224,0,192,0,255,128,255,0,5,14,14,6,0,
0,248,192,192,192,192,192,192,192,192,192,192,192,192,248,9,
14,28,10,0,0,192,0,96,0,96,0,48,0,48,0,24,
0,24,0,12,0,12,0,6,0,6,0,3,0,3,0,1,
128,5,14,14,6,0,0,248,24,24,24,24,24,24,24,24,
24,24,24,24,248,9,6,12,10,0,8,8,0,28,0,54,
0,99,0,193,128,128,128,10,1,2,10,0,255,255,192,4,
3,3,5,0,12,224,96,48,8,11,11,9,0,0,124,127,
3,3,59,123,227,195,199,255,123,9,13,26,10,0,0,64,
0,192,0,192,0,192,0,192,0,222,0,223,0,195,128,193,
128,193,128,195,0,255,0,222,0,8,11,11,9,0,0,30,
63,115,224,192,192,192,224,240,127,30,9,13,26,10,0,0,
0,128,1,128,1,128,1,128,1,128,61,128,125,128,225,128,
193,128,193,128,227,128,127,128,61,128,8,11,11,9,0,0,
60,126,231,195,195,223,222,192,227,127,62,7,13,13,8,0,
0,62,124,96,96,252,248,96,96,96,96,96,96,32,8,13,
13,9,0,0,63,127,227,195,195,195,227,123,51,3,3,127,
254,8,13,13,9,0,0,64,192,192,192,222,223,195,195,195,
195,195,195,130,2,13,13,3,0,0,64,192,128,64,192,192,
192,192,192,192,192,192,128,5,14,14,6,0,255,16,24,24,
8,48,120,24,24,24,24,24,24,120,240,8,13,13,9,0,
0,64,192,192,198,198,204,216,216,216,204,198,199,131,2,14,
14,3,0,0,64,192,192,192,192,192,192,192,192,192,192,192,
192,128,9,11,22,10,0,0,91,0,219,128,201,128,201,128,
201,128,201,128,201,128,201,128,201,128,193,128,129,0,8,11,
11,9,0,0,94,223,195,195,195,195,195,195,195,195,130,8,
11,11,9,0,0,52,118,227,195,195,195,195,195,227,118,52,
8,11,11,9,0,0,252,254,199,195,199,222,220,192,192,192,
128,9,13,26,9,0,255,63,0,127,0,227,0,195,0,195,
0,195,0,251,0,123,0,3,0,3,0,3,128,3,128,3,
128,7,11,11,8,0,0,92,222,224,224,192,192,192,192,192,
192,128,8,11,11,9,0,0,62,127,192,192,240,102,15,3,
3,254,124,6,13,13,7,0,0,32,96,96,252,248,96,96,
96,96,96,96,124,60,8,11,11,9,0,0,65,195,195,195,
195,195,195,195,227,123,58,8,11,11,9,0,0,129,129,195,
195,102,102,102,36,60,24,24,9,11,22,10,0,0,128,128,
193,128,201,128,201,128,201,128,201,128,193,128,221,128,247,128,
227,128,65,0,8,11,11,9,0,0,195,102,102,52,24,24,
24,52,102,102,195,8,12,12,9,0,255,193,227,99,102,110,
44,12,24,24,48,240,224,8,11,11,9,0,0,127,255,7,
6,12,0,48,96,224,255,254,7,14,14,8,0,0,14,28,
24,24,24,48,224,224,48,24,24,24,28,14,2,16,16,5,
1,255,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,8,14,14,9,0,0,224,112,24,24,24,12,7,7,
12,24,24,24,112,224,10,5,10,11,0,4,48,192,120,192,
204,192,199,128,195,0,5,13,13,6,0,1,248,136,136,136,
136,136,136,136,136,136,136,136,248,8,11,11,9,0,0,252,
254,199,195,199,222,220,192,192,192,128,8,11,11,9,0,0,
30,63,115,224,192,192,192,224,240,127,30,8,11,11,9,0,
0,127,254,24,24,24,24,24,24,24,24,16,8,12,12,9,
0,255,193,227,99,102,110,44,12,24,24,48,240,224,8,12,
12,9,0,255,126,255,219,219,219,219,90,24,24,24,24,16,
8,11,11,9,0,0,195,102,102,52,24,24,24,52,102,102,
195,8,12,12,9,0,255,132,198,198,198,198,198,198,198,198,
254,255,3,8,11,11,9,0,0,65,195,195,195,231,127,63,
3,3,3,2,8,11,11,9,0,0,130,195,195,211,219,219,
219,219,219,203,255,8,12,12,9,0,255,130,195,195,211,219,
219,219,219,218,200,255,3,8,11,11,9,0,0,192,224,96,
96,108,110,103,99,103,126,124,8,11,11,9,0,0,130,195,
195,195,219,221,207,199,207,253,251,8,11,11,9,0,0,64,
192,192,192,220,222,199,195,199,254,252,8,11,11,9,0,0,
124,254,198,3,27,59,3,3,6,254,120,9,11,22,10,0,
0,71,0,207,128,205,128,205,128,221,128,221,128,205,128,205,
128,205,128,207,128,135,0,8,11,11,9,0,0,63,127,227,
195,227,123,59,51,51,115,226,9,14,28,10,0,0,252,0,
254,0,199,0,195,128,193,128,193,128,193,128,253,128,253,128,
193,128,193,128,193,128,193,128,129,0,9,14,28,10,0,0,
223,128,223,0,192,0,192,0,192,0,192,0,222,0,223,0,
195,128,193,128,193,128,195,128,255,0,254,0,9,14,28,10,
0,0,94,0,223,0,195,128,193,128,193,128,195,128,255,0,
255,0,195,128,193,128,193,128,195,128,223,0,190,0,9,14,
28,10,0,0,223,0,223,128,192,0,192,0,192,0,192,0,
192,0,192,0,192,0,192,0,192,0,192,0,192,0,128,0,
9,14,28,10,0,0,11,0,27,0,59,0,115,0,99,0,
99,0,99,0,99,0,99,0,99,0,123,0,251,128,193,128,
193,128,9,14,28,10,0,0,95,128,223,0,192,0,192,0,
192,0,192,0,223,0,222,0,192,0,192,0,192,0,192,0,
223,128,191,0,10,14,28,11,0,0,64,64,192,192,196,192,
204,192,204,192,109,128,109,128,109,128,109,128,204,192,204,192,
204,192,200,192,128,128,9,14,28,10,0,0,122,0,251,0,
131,128,1,128,1,128,3,0,58,0,123,0,3,128,1,128,
1,128,131,128,251,0,120,0,9,14,28,10,0,0,67,128,
195,128,199,128,199,128,199,128,205,128,205,128,205,128,217,128,
217,128,217,128,209,128,209,128,193,0,9,14,28,10,0,0,
91,128,219,128,215,128,199,128,199,128,205,128,205,128,205,128,
217,128,217,128,217,128,209,128,209,128,193,0,9,14,28,10,
0,0,65,128,195,128,199,0,206,0,220,0,216,0,216,0,
216,0,216,0,220,0,206,0,199,0,195,128,65,128,9,14,
28,10,0,0,220,0,222,0,199,0,195,128,193,128,193,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
9,14,28,10,0,0,193,128,227,128,247,128,247,128,213,128,
193,128,213,128,221,128,221,128,201,128,193,128,193,128,193,128,
129,0,9,14,28,10,0,0,129,0,193,128,193,128,193,128,
193,128,193,128,223,128,223,128,193,128,193,128,193,128,193,128,
193,128,64,128,9,14,28,10,0,0,46,0,111,0,227,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
227,128,123,0,58,0,9,14,28,10,0,0,223,128,223,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
193,128,193,128,193,128,129,0,9,14,28,10,0,0,254,0,
255,0,195,128,193,128,193,128,195,128,223,0,222,0,192,0,
192,0,192,0,192,0,192,0,128,0,9,14,28,10,0,0,
14,0,63,0,115,128,97,128,192,0,192,0,192,0,192,0,
192,0,192,0,96,0,112,0,63,128,15,0,9,14,28,10,
0,0,255,0,127,128,0,0,12,0,12,0,12,0,12,0,
12,0,12,0,12,0,12,0,12,0,12,0,4,0,9,14,
28,10,0,0,129,0,193,128,193,128,193,128,193,128,125,128,
61,128,1,128,1,128,1,128,193,128,225,128,127,0,62,0,
10,14,28,11,0,0,63,0,127,128,237,192,204,192,204,192,
237,192,109,128,45,0,12,0,12,0,12,0,12,0,12,0,
4,0,9,14,28,10,0,0,193,128,193,128,193,128,99,0,
99,0,50,0,56,0,28,0,14,0,103,0,99,0,193,128,
193,128,193,128,10,15,30,10,0,255,130,0,195,0,195,0,
195,0,195,0,195,0,195,0,195,0,195,0,195,0,195,0,
195,0,223,0,223,128,1,192,9,14,28,10,0,0,129,0,
193,128,193,128,193,128,193,128,193,128,225,128,125,128,61,128,
1,128,1,128,1,128,1,128,0,128,10,14,28,11,0,0,
128,128,192,192,192,192,192,192,200,192,204,192,204,192,204,192,
204,192,204,192,196,192,192,64,223,128,95,192,11,15,30,11,
0,255,128,128,192,192,192,192,192,192,200,192,204,192,204,192,
204,192,204,192,204,192,196,192,192,64,223,128,95,192,0,224,
9,14,28,10,0,0,224,0,224,0,96,0,96,0,96,0,
96,0,110,0,111,0,99,128,97,128,97,128,99,128,127,0,
62,0,10,14,28,11,0,0,128,128,192,192,192,192,192,192,
192,192,192,192,220,192,222,192,199,64,195,64,195,64,199,64,
254,192,124,192,9,14,28,10,0,0,128,0,192,0,192,0,
192,0,192,0,192,0,222,0,223,0,195,128,193,128,193,128,
195,128,255,0,254,0,9,14,28,10,0,0,62,0,127,0,
227,128,193,128,193,128,1,128,29,128,29,128,1,128,1,128,
193,128,227,128,127,0,62,0,10,14,28,11,0,0,71,0,
207,128,221,192,216,192,216,192,216,192,248,192,248,192,216,192,
216,192,216,192,221,192,207,128,135,0,9,14,28,10,0,0,
63,128,127,128,225,128,193,128,193,128,225,128,125,128,61,128,
29,128,57,128,113,128,225,128,193,128,129,0,8,11,11,9,
0,0,124,127,3,3,59,123,227,195,199,255,123,8,11,11,
9,0,0,7,31,56,112,102,207,195,195,231,126,60,8,11,
11,9,0,0,92,222,198,198,220,222,195,195,199,222,188,8,
11,11,9,0,0,254,255,192,192,192,192,192,192,192,192,128,
10,11,22,11,0,0,31,128,31,128,25,128,49,128,49,128,
49,128,1,128,127,192,255,192,192,192,192,192,8,11,11,9,
0,0,60,126,231,195,195,223,222,192,227,127,62,9,11,22,
10,0,0,64,128,201,128,201,128,107,0,54,0,54,0,107,
0,201,128,201,128,201,128,129,0,8,11,11,9,0,0,116,
246,195,7,126,62,6,3,7,254,124,8,11,11,9,0,0,
65,195,195,199,207,223,219,211,195,195,130,8,11,11,9,0,
0,89,219,211,199,207,223,219,211,195,195,130,8,11,11,9,
0,0,71,207,204,220,216,216,216,220,206,199,67,8,11,11,
9,0,0,27,59,115,227,195,195,195,195,195,195,195,9,11,
22,10,0,0,65,0,227,128,247,128,247,128,213,128,213,128,
213,128,213,128,193,128,193,128,129,0,8,11,11,9,0,0,
65,195,195,251,251,195,195,195,195,195,130,8,11,11,9,0,
0,52,118,227,195,195,195,195,195,227,118,52,8,11,11,9,
0,0,95,223,195,195,195,195,195,195,195,195,130,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255};
За ранее благодарен.
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 13:59
#30
ua6em

Онлайн
Зарегистрирован: 17.08.2016
/***************************************************************************
* Name : DDS_Sweeper.BAS *
* Author : Beric Dunn (K6BEZ) *
* Notice : Copyright (c) 2013 CC-BY-SA *
* : Creative Commons Attribution-ShareAlike 3.0 Unported License *
* Date : 9/26/2013 *
* Version : 1.0 *
* Notes : Written using for the Arduino Micro *
* : Pins: *
* : A0 - Reverse Detector Analog in *
* : A1 - Forward Detector Analog in *
* : Modified by Norbert Redeker (DG7EAO) 07/2014 *
* : TFT Display mit ILI9341 Chip, SPI, 240 x 320 *
* : usglib Grafik Bibliothek https://code.google.com/p/ucglib/ *
***************************************************************************/
#include <SPI.h>
#include "Ucglib.h"
#include "rusFont.h"
// Define Pins used to control AD9850 DDS
const int FQ_UD=11;
const int SDAT=10;
const int SCLK=12;
const int RESET=9;
// Variablen für Display
double vswrArray[110]; //Array für SWR
int z = 0; // Index für Array
double SwrFreq = 14; // Variable für Freq. mit SWR Min.
double SwrMin = 100; // Variable für SWR Min.
double Freq1 = 1; // Freq. Links unterste Zeile Display
double Freq2 = 15; // Freq. Mitte unterste Zeile Display
double Freq3 = 30; // Freq. Mitte unterste Zeile Display
unsigned long milliold = 0; //Millisekunden für Entprellung Interrupt
unsigned long millinew = 0; //Millisekunden für Entprellung Interrupt
int flag = 0; // wir auf 1 gesetzt bei Interrupt, in void Loop perform_sweep
double counter = 0; // Zähler um erste Interrupts zu ignorieren
// Variablen für Messung
double Fstart_MHz = 1; // Start Frequency for sweep
double Fstop_MHz = 30; // Stop Frequency for sweep
double current_freq_MHz; // Temp variable used during sweep
long serial_input_number; // Used to build number from serial stream
int num_steps = 100; // Number of steps to use in the sweep
char incoming_char; // Character read from serial stream
//Konstruktor für Display
Ucglib_ST7735_18x128x160_SWSPI ucg(/*sclk=*/ 12, /*data=*/ 10, /*cd=*/ 6 , /*cs=*/ 5, /*reset=*/ 4);
// the setup routine runs once when you press reset:
void setup() {
// Voltmetr
analogReference(INTERNAL);
float Vbat = (analogRead(A5) * 1.1) / 1023.0;
float Vin = Vbat / (69.8 / (783.0 + 69.8)); // R2/(R1+R2)
// Schreibe Info Text auf Display
ucg.begin(UCG_FONT_MODE_SOLID);
ucg.clearScreen();
ucg.setRotate90();
ucg.setFont(ucg_font_9x15_tf);
ucg.setColor(255, 255, 255);
ucg.setPrintPos(10,20);
ucg.print("Arduino Antenna");
ucg.setPrintPos(25,40);
ucg.print("SWR Analyzer");
ucg.setPrintPos(35,60);
ucg.print("1-30 MHz");
ucg.setPrintPos(20,80);
ucg.print("Komsomolsk 2017");
ucg.setPrintPos(5,128);
ucg.print("BAT");
ucg.setPrintPos(40,128);
ucg.print(Vin, 1);
// Configiure DDS control pins for digital output
pinMode(FQ_UD,OUTPUT);
pinMode(SCLK,OUTPUT);
pinMode(SDAT,OUTPUT);
pinMode(RESET,OUTPUT);
//Tasten Interrupt an PIN 2
pinMode(2,OUTPUT);
digitalWrite(2, HIGH);
attachInterrupt(0, key2, FALLING);
unsigned long milliold = millis();
//Tasten Interrupt an PIN 3
pinMode(3,OUTPUT);
digitalWrite(3, HIGH);
attachInterrupt(1, key3, FALLING);
//milliold = millis();
// Configure LED pin for digital output
pinMode(13,OUTPUT);
// Set up analog inputs on A0 and A1, internal reference voltage
pinMode(A0,INPUT);
pinMode(A1,INPUT);
analogReference(INTERNAL);
// initialize serial communication at 57600 baud
Serial.begin(57600);
// Reset the DDS
digitalWrite(RESET,HIGH);
digitalWrite(RESET,LOW);
//Initialise the incoming serial number to zero
serial_input_number=0;
}
// the loop routine runs over and over again forever:
void loop() {
//Check for character
if(Serial.available()>0){
incoming_char = Serial.read();
switch(incoming_char){
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
serial_input_number=serial_input_number*10+(incoming_char-'0');
break;
case 'A':
//Turn frequency into FStart
Fstart_MHz = ((double)serial_input_number)/1000000;
serial_input_number=0;
break;
case 'B':
//Turn frequency into FStop
Fstop_MHz = ((double)serial_input_number)/1000000;
serial_input_number=0;
break;
case 'C':
//Turn frequency into FStart and set DDS output to single frequency
Fstart_MHz = ((double)serial_input_number)/1000000;
//SetDDSFreq(Fstart_MHz);
SetDDSFreq(Fstart_MHz * 1000000);
delay(100);
SetDDSFreq(Fstart_MHz * 1000000);
serial_input_number=0;
break;
case 'N':
// Set number of steps in the sweep
num_steps = serial_input_number;
serial_input_number=0;
break;
case 'S':
case 's':
Perform_sweep();
break;
case '?':
// Report current configuration to PC
Serial.print("Start Freq:");
Serial.println(Fstart_MHz*1000000);
Serial.print("Stop Freq:");
Serial.println(Fstop_MHz*1000000);
Serial.print("Num Steps:");
Serial.println(num_steps);
break;
}
Serial.flush();
}
//Perform Sweep nach Interrupt PIN2 oder 3
// ingnoriere Startup Interrupts durch counter
if (flag == 1 && counter >2)
{
flag = 0;
Perform_sweep();
}
}
void Perform_sweep(){
double FWD=0;
double REV=0;
double VSWR;
double Fstep_MHz = (Fstop_MHz-Fstart_MHz)/num_steps;
z = 0;
SwrMin = 100;
ucg.clearScreen();
ucg.setFont(ucg_font_9x15_tf);
ucg.setColor(255, 0, 100);
ucg.setPrintPos(35,60);
ucg.print("Analiz KSW");
// Start loop
for(int i=0;i<=num_steps;i++){
// Calculate current frequency
current_freq_MHz = Fstart_MHz + i*Fstep_MHz;
// Set DDS to current frequency
SetDDSFreq(current_freq_MHz*1000000);
// Wait a little for settling
//delay(10);
delay(100);
// Read the forward and reverse voltages
REV = analogRead(A0);
FWD = analogRead(A1);
//Offset Korrektur
REV = REV-1;
if(REV>=FWD){
REV = FWD-1;
}
if (REV <1) {
REV = 1;
}
VSWR = (FWD+REV)/(FWD-REV);
//Skalieren für Ausgabe
VSWR = VSWR * 1000;
// Send current line back to PC over serial bus
Serial.print(current_freq_MHz*1000000);
Serial.print(",0,");
Serial.print(VSWR);
Serial.print(",");
Serial.print(FWD);
Serial.print(",");
Serial.println(REV);
// Übergebe SWR an Array
// ERmittele Freq bei niedrigsten SWR
vswrArray[z] = VSWR/1000;
if (vswrArray[z] > 10) vswrArray[z] = 10;
if (vswrArray[z] < SwrMin && vswrArray[z] > 1)
{
SwrMin = vswrArray[z];
SwrFreq = current_freq_MHz;
}
z = z + 1;
}
// Send "End" to PC to indicate end of sweep
Serial.println("End");
Serial.flush();
ucg.clearScreen();
//Zeichne Grid
CreateGrid();
ucg.setColor(76, 255, 0);
// Draw Line
double last = 10;
double xx = 6;
double j = 1;
for (int i = 1 ;i < 103; i++){
xx = vswrArray[i];
ucg.drawLine(j,105-last*9, j+1, 105-xx*9);
ucg.drawLine(j+1,105-last*9, j+2, 105-xx*9);
j = j + 1.5;
last = xx;
}
}
// Setze DDS Frequenz
void SetDDSFreq(double Freq_Hz){
// Calculate the DDS word - from AD9850 Datasheet
int32_t f = Freq_Hz * 4294967295/125000000;
// Send one byte at a time
for (int b=0;b<4;b++,f>>=8){
send_byte(f & 0xFF);
}
// 5th byte needs to be zeros
send_byte(0);
// Strobe the Update pin to tell DDS to use values
digitalWrite(FQ_UD,HIGH);
digitalWrite(FQ_UD,LOW);
}
// Sende Daten an DDS
void send_byte(byte data_to_send){
// Bit bang the byte over the SPI bus
for (int i=0; i<8; i++,data_to_send>>=1){
// Set Data bit on output pin
digitalWrite(SDAT,data_to_send & 0x01);
// Strobe the clock pin
digitalWrite(SCLK,HIGH);
digitalWrite(SCLK,LOW);
}
}
//Zeichne Grid auf TFT Display
void CreateGrid()
{
//ucg.clearScreen();
double maxSwr = 10;
ucg.setFont(ucg_font_9x15_tf);
ucg.drawHLine(0,60,155);
ucg.drawHLine(0,98,155);
ucg.drawVLine(39,15,90);
ucg.drawVLine(78,15,90);
ucg.drawVLine(117,15,90);
ucg.setPrintPos(0, 118);
ucg.print(Freq1,3);
ucg.setPrintPos(65, 118);
ucg.print(Freq2,3);
ucg.setPrintPos(130, 118);
ucg.print(Freq3,3);
ucg.setPrintPos(1, 11);
ucg.print("SWR");
ucg.setPrintPos(30, 11);
ucg.print(SwrMin,2);
ucg.setPrintPos(65, 11);
ucg.print(">");
ucg.setPrintPos(75, 11);
ucg.print(maxSwr,2);
ucg.setPrintPos(125, 11);
ucg.print(SwrFreq,3);
ucg.drawRFrame(0,15,155,90, 1);
}
// Interrupt Service Routine
// Abfrage Low an Pin 2
void key2()
{
//ignoriere Startup Interrupts > counter
counter = counter + 1;
//Entprellen mit millis()
millinew = millis();
if (millinew - milliold < 1000)
{
milliold = millinew;
return;
}
milliold = millinew;
Fstart_MHz = 1; // Start Frequency for sweep
Fstop_MHz = 30; // Stop Frequency for sweep
num_steps = 102; // Steps
Freq1 = 1; // Unterste Zeile Display Freq. Links
Freq2 = 15; // Unterste Zeile Display Freq. Mitte
Freq3 = 30; // Unterste Zeile Display Freq. Recht
//Perform_sweep();
flag = 1;
}
// Interrupt Service Routine
// Abfrage Low an Pin 3
void key3()
{
//ignoriere Startup Interrupts > counter
counter = counter + 1;
//Entprellen mit millis()
millinew = millis();
if (millinew - milliold < 1000)
{
milliold = millinew;
return;
}
milliold = millinew;
int x = SwrFreq + 0.5; //Runde auf Mhz
Fstart_MHz = x-1; // Start Frequency for sweep
Fstop_MHz = x+1; // Stop Frequency for sweep
num_steps = 102; // Steps
Freq1 = x-1; // Unterste Zeile Display Freq. Links
Freq2 = x; // Unterste Zeile Display Freq. Mitte
Freq3 = x+1; // Unterste Zeile Display Freq. Rechts
//Perform_sweep();
flag = 1;
}
плюс Русский текст , он в том - же скетче- const ucg_fntpgm_uint8_t my14x10rus[4157] UCG_SECTION(".progmem.my14x10") = {
0,11,15,0,255,14,3,35,6,248,32,255,0,15,255,14,
0,0,0,0,8,0,0,2,14,14,4,1,0,64,192,192,
192,192,192,192,192,192,128,0,64,192,128,6,5,5,7,0,
9,68,204,204,204,136,10,14,28,11,0,0,8,128,8,128,
17,0,17,0,127,192,17,0,17,0,34,0,34,0,255,128,
34,0,34,0,68,0,68,0,9,14,28,10,0,0,8,0,
8,0,59,128,123,0,200,0,200,0,232,0,107,0,11,128,
9,128,9,128,111,0,238,0,8,0,8,14,14,9,0,0,
97,179,214,102,12,12,24,24,48,48,102,107,205,134,9,14,
28,10,0,0,56,0,124,0,108,0,108,0,108,0,56,0,
56,128,109,128,199,0,194,0,199,0,237,128,124,128,56,0,
2,5,5,3,0,10,128,192,192,192,64,5,14,14,6,0,
0,24,48,96,96,192,192,192,192,192,192,96,96,48,24,5,
14,14,6,0,0,192,96,48,48,24,24,24,24,24,24,56,
48,96,192,7,7,7,8,0,4,146,214,124,16,124,214,146,
8,10,10,10,0,1,8,24,24,24,127,254,24,24,24,16,
4,6,6,5,0,0,112,96,96,64,192,192,8,2,2,9,
0,5,127,254,3,3,3,4,0,0,224,160,224,8,14,14,
9,0,0,3,3,6,6,12,12,24,24,48,48,96,96,192,
192,9,14,28,10,0,0,62,0,127,0,227,128,197,128,197,
128,197,128,201,128,201,128,209,128,209,128,209,128,227,128,127,
0,62,0,9,14,28,10,0,0,12,0,28,0,60,0,124,
0,8,0,4,0,12,0,12,0,8,0,4,0,12,0,12,
0,127,128,255,128,9,14,28,10,0,0,126,0,255,0,195,
128,193,128,1,128,3,128,63,0,126,0,224,0,192,0,192,
0,192,0,223,128,191,0,9,14,28,10,0,0,126,0,255,
0,195,128,1,128,1,128,3,0,58,0,119,0,3,128,1,
128,1,128,3,128,255,0,126,0,9,14,28,10,0,0,2,
0,6,0,14,0,30,0,62,0,118,0,230,0,198,0,251,
128,247,0,6,0,6,0,6,0,4,0,9,14,28,10,0,
0,127,128,127,128,96,0,96,0,96,0,110,0,111,0,3,
128,1,128,1,128,1,128,195,0,255,0,124,0,9,14,28,
10,0,0,31,0,127,0,96,0,192,0,192,0,192,0,222,
0,223,0,195,128,193,128,193,128,227,0,127,0,60,0,9,
14,28,10,0,0,127,128,255,128,0,0,3,0,3,0,6,
0,6,0,12,0,12,0,24,0,24,0,48,0,48,0,32,
0,9,14,28,10,0,0,58,0,119,0,227,128,193,128,193,
128,99,0,54,0,111,0,227,128,193,128,193,128,227,128,119,
0,46,0,9,14,28,10,0,0,60,0,255,0,231,0,195,
128,193,128,193,128,225,128,253,128,125,128,1,128,3,128,7,
0,127,0,252,0,3,11,11,4,0,2,224,160,224,0,0,
0,0,0,224,160,224,4,13,13,5,0,0,112,80,112,0,
0,0,0,0,112,80,112,96,192,9,11,22,10,0,1,1,
128,3,128,15,0,28,0,120,0,224,0,120,0,28,0,15,
0,3,128,1,128,9,6,12,10,0,4,127,128,255,0,0,
0,0,0,127,128,255,0,9,11,22,10,0,1,192,0,224,
0,120,0,60,0,15,0,3,128,15,0,60,0,120,0,224,
0,192,0,8,14,14,9,0,0,116,238,135,3,3,6,14,
56,48,48,0,0,48,48,9,11,22,10,0,1,62,0,65,
0,128,128,154,128,166,128,162,128,162,128,166,128,155,0,64,
0,63,128,9,14,28,10,0,0,252,0,254,0,199,0,195,
128,193,128,193,128,193,128,253,128,253,128,193,128,193,128,193,
128,193,128,129,0,9,14,28,10,0,0,94,0,223,0,195,
128,193,128,193,128,195,128,255,0,255,0,195,128,193,128,193,
128,195,128,223,0,190,0,9,14,28,10,0,0,14,0,63,
0,115,128,97,128,192,0,192,0,192,0,192,0,192,0,192,
0,96,0,112,0,63,128,15,0,9,14,28,10,0,0,238,
0,111,0,99,128,97,128,97,128,97,128,97,128,97,128,97,
128,97,128,97,128,99,128,111,0,238,0,9,14,28,10,0,
0,95,128,223,0,192,0,192,0,192,0,192,0,223,0,222,
0,192,0,192,0,192,0,192,0,223,128,191,0,9,14,28,
10,0,0,95,128,223,0,192,0,192,0,192,0,192,0,223,
0,222,0,192,0,192,0,192,0,192,0,192,0,128,0,9,
14,28,10,0,0,63,128,127,128,225,128,192,0,192,0,192,
0,192,0,207,128,223,128,193,128,193,128,225,128,127,128,62,
0,9,14,28,10,0,0,129,0,193,128,193,128,193,128,193,
128,193,128,223,128,223,128,193,128,193,128,193,128,193,128,193,
128,64,128,8,14,14,10,1,0,254,127,24,24,24,24,24,
24,24,24,24,24,254,127,9,14,28,10,0,0,31,128,63,
128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,
128,1,128,195,128,255,0,62,0,9,14,28,10,0,0,65,
128,195,128,199,0,206,0,220,0,216,0,216,0,216,0,216,
0,220,0,206,0,199,0,195,128,65,128,9,14,28,10,0,
0,64,0,192,0,192,0,192,0,192,0,192,0,192,0,192,
0,192,0,192,0,192,0,192,0,255,128,255,0,9,14,28,
10,0,0,193,128,227,128,247,128,247,128,213,128,193,128,213,
128,221,128,221,128,201,128,193,128,193,128,193,128,129,0,9,
14,28,10,0,0,225,0,225,128,241,128,241,128,249,128,217,
128,221,128,205,128,205,128,197,128,197,128,193,128,193,128,128,
128,9,14,28,10,0,0,46,0,111,0,227,128,193,128,193,
128,193,128,193,128,193,128,193,128,193,128,193,128,227,128,123,
0,58,0,9,14,28,10,0,0,254,0,255,0,195,128,193,
128,193,128,195,128,223,0,222,0,192,0,192,0,192,0,192,
0,192,0,128,0,10,15,30,10,0,255,46,0,111,0,227,
128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,
128,227,0,123,128,58,192,0,192,9,14,28,10,0,0,126,
0,255,0,195,128,193,128,193,128,195,128,223,0,220,0,206,
0,199,0,195,128,193,128,193,128,129,0,9,14,28,10,0,
0,62,0,127,0,224,0,192,0,192,0,224,0,118,0,27,
0,3,128,1,128,1,128,3,128,255,128,127,0,9,14,28,
10,0,0,255,0,127,128,0,0,12,0,12,0,12,0,12,
0,12,0,12,0,12,0,12,0,12,0,12,0,4,0,9,
14,28,10,0,0,64,128,193,128,193,128,193,128,193,128,193,
128,193,128,193,128,193,128,193,128,193,128,99,0,127,0,62,
0,9,14,28,10,0,0,227,128,99,0,99,0,99,0,34,
0,54,0,54,0,54,0,20,0,28,0,28,0,28,0,8,
0,8,0,10,14,28,11,0,0,64,64,192,192,192,192,192,
192,192,192,192,192,204,192,204,192,204,192,222,192,222,192,211,
192,193,192,128,192,9,14,28,10,0,0,193,128,193,128,193,
128,99,0,99,0,50,0,56,0,28,0,14,0,103,0,99,
0,193,128,193,128,193,128,10,14,28,10,0,0,192,192,192,
192,97,128,97,128,51,0,63,0,30,0,12,0,8,0,4,
0,12,0,12,0,12,0,8,0,9,14,28,10,0,0,127,
128,255,128,1,128,3,128,7,0,6,0,4,0,16,0,48,
0,112,0,224,0,192,0,255,128,255,0,5,14,14,6,0,
0,248,192,192,192,192,192,192,192,192,192,192,192,192,248,9,
14,28,10,0,0,192,0,96,0,96,0,48,0,48,0,24,
0,24,0,12,0,12,0,6,0,6,0,3,0,3,0,1,
128,5,14,14,6,0,0,248,24,24,24,24,24,24,24,24,
24,24,24,24,248,9,6,12,10,0,8,8,0,28,0,54,
0,99,0,193,128,128,128,10,1,2,10,0,255,255,192,4,
3,3,5,0,12,224,96,48,8,11,11,9,0,0,124,127,
3,3,59,123,227,195,199,255,123,9,13,26,10,0,0,64,
0,192,0,192,0,192,0,192,0,222,0,223,0,195,128,193,
128,193,128,195,0,255,0,222,0,8,11,11,9,0,0,30,
63,115,224,192,192,192,224,240,127,30,9,13,26,10,0,0,
0,128,1,128,1,128,1,128,1,128,61,128,125,128,225,128,
193,128,193,128,227,128,127,128,61,128,8,11,11,9,0,0,
60,126,231,195,195,223,222,192,227,127,62,7,13,13,8,0,
0,62,124,96,96,252,248,96,96,96,96,96,96,32,8,13,
13,9,0,0,63,127,227,195,195,195,227,123,51,3,3,127,
254,8,13,13,9,0,0,64,192,192,192,222,223,195,195,195,
195,195,195,130,2,13,13,3,0,0,64,192,128,64,192,192,
192,192,192,192,192,192,128,5,14,14,6,0,255,16,24,24,
8,48,120,24,24,24,24,24,24,120,240,8,13,13,9,0,
0,64,192,192,198,198,204,216,216,216,204,198,199,131,2,14,
14,3,0,0,64,192,192,192,192,192,192,192,192,192,192,192,
192,128,9,11,22,10,0,0,91,0,219,128,201,128,201,128,
201,128,201,128,201,128,201,128,201,128,193,128,129,0,8,11,
11,9,0,0,94,223,195,195,195,195,195,195,195,195,130,8,
11,11,9,0,0,52,118,227,195,195,195,195,195,227,118,52,
8,11,11,9,0,0,252,254,199,195,199,222,220,192,192,192,
128,9,13,26,9,0,255,63,0,127,0,227,0,195,0,195,
0,195,0,251,0,123,0,3,0,3,0,3,128,3,128,3,
128,7,11,11,8,0,0,92,222,224,224,192,192,192,192,192,
192,128,8,11,11,9,0,0,62,127,192,192,240,102,15,3,
3,254,124,6,13,13,7,0,0,32,96,96,252,248,96,96,
96,96,96,96,124,60,8,11,11,9,0,0,65,195,195,195,
195,195,195,195,227,123,58,8,11,11,9,0,0,129,129,195,
195,102,102,102,36,60,24,24,9,11,22,10,0,0,128,128,
193,128,201,128,201,128,201,128,201,128,193,128,221,128,247,128,
227,128,65,0,8,11,11,9,0,0,195,102,102,52,24,24,
24,52,102,102,195,8,12,12,9,0,255,193,227,99,102,110,
44,12,24,24,48,240,224,8,11,11,9,0,0,127,255,7,
6,12,0,48,96,224,255,254,7,14,14,8,0,0,14,28,
24,24,24,48,224,224,48,24,24,24,28,14,2,16,16,5,
1,255,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,8,14,14,9,0,0,224,112,24,24,24,12,7,7,
12,24,24,24,112,224,10,5,10,11,0,4,48,192,120,192,
204,192,199,128,195,0,5,13,13,6,0,1,248,136,136,136,
136,136,136,136,136,136,136,136,248,8,11,11,9,0,0,252,
254,199,195,199,222,220,192,192,192,128,8,11,11,9,0,0,
30,63,115,224,192,192,192,224,240,127,30,8,11,11,9,0,
0,127,254,24,24,24,24,24,24,24,24,16,8,12,12,9,
0,255,193,227,99,102,110,44,12,24,24,48,240,224,8,12,
12,9,0,255,126,255,219,219,219,219,90,24,24,24,24,16,
8,11,11,9,0,0,195,102,102,52,24,24,24,52,102,102,
195,8,12,12,9,0,255,132,198,198,198,198,198,198,198,198,
254,255,3,8,11,11,9,0,0,65,195,195,195,231,127,63,
3,3,3,2,8,11,11,9,0,0,130,195,195,211,219,219,
219,219,219,203,255,8,12,12,9,0,255,130,195,195,211,219,
219,219,219,218,200,255,3,8,11,11,9,0,0,192,224,96,
96,108,110,103,99,103,126,124,8,11,11,9,0,0,130,195,
195,195,219,221,207,199,207,253,251,8,11,11,9,0,0,64,
192,192,192,220,222,199,195,199,254,252,8,11,11,9,0,0,
124,254,198,3,27,59,3,3,6,254,120,9,11,22,10,0,
0,71,0,207,128,205,128,205,128,221,128,221,128,205,128,205,
128,205,128,207,128,135,0,8,11,11,9,0,0,63,127,227,
195,227,123,59,51,51,115,226,9,14,28,10,0,0,252,0,
254,0,199,0,195,128,193,128,193,128,193,128,253,128,253,128,
193,128,193,128,193,128,193,128,129,0,9,14,28,10,0,0,
223,128,223,0,192,0,192,0,192,0,192,0,222,0,223,0,
195,128,193,128,193,128,195,128,255,0,254,0,9,14,28,10,
0,0,94,0,223,0,195,128,193,128,193,128,195,128,255,0,
255,0,195,128,193,128,193,128,195,128,223,0,190,0,9,14,
28,10,0,0,223,0,223,128,192,0,192,0,192,0,192,0,
192,0,192,0,192,0,192,0,192,0,192,0,192,0,128,0,
9,14,28,10,0,0,11,0,27,0,59,0,115,0,99,0,
99,0,99,0,99,0,99,0,99,0,123,0,251,128,193,128,
193,128,9,14,28,10,0,0,95,128,223,0,192,0,192,0,
192,0,192,0,223,0,222,0,192,0,192,0,192,0,192,0,
223,128,191,0,10,14,28,11,0,0,64,64,192,192,196,192,
204,192,204,192,109,128,109,128,109,128,109,128,204,192,204,192,
204,192,200,192,128,128,9,14,28,10,0,0,122,0,251,0,
131,128,1,128,1,128,3,0,58,0,123,0,3,128,1,128,
1,128,131,128,251,0,120,0,9,14,28,10,0,0,67,128,
195,128,199,128,199,128,199,128,205,128,205,128,205,128,217,128,
217,128,217,128,209,128,209,128,193,0,9,14,28,10,0,0,
91,128,219,128,215,128,199,128,199,128,205,128,205,128,205,128,
217,128,217,128,217,128,209,128,209,128,193,0,9,14,28,10,
0,0,65,128,195,128,199,0,206,0,220,0,216,0,216,0,
216,0,216,0,220,0,206,0,199,0,195,128,65,128,9,14,
28,10,0,0,220,0,222,0,199,0,195,128,193,128,193,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
9,14,28,10,0,0,193,128,227,128,247,128,247,128,213,128,
193,128,213,128,221,128,221,128,201,128,193,128,193,128,193,128,
129,0,9,14,28,10,0,0,129,0,193,128,193,128,193,128,
193,128,193,128,223,128,223,128,193,128,193,128,193,128,193,128,
193,128,64,128,9,14,28,10,0,0,46,0,111,0,227,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
227,128,123,0,58,0,9,14,28,10,0,0,223,128,223,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
193,128,193,128,193,128,129,0,9,14,28,10,0,0,254,0,
255,0,195,128,193,128,193,128,195,128,223,0,222,0,192,0,
192,0,192,0,192,0,192,0,128,0,9,14,28,10,0,0,
14,0,63,0,115,128,97,128,192,0,192,0,192,0,192,0,
192,0,192,0,96,0,112,0,63,128,15,0,9,14,28,10,
0,0,255,0,127,128,0,0,12,0,12,0,12,0,12,0,
12,0,12,0,12,0,12,0,12,0,12,0,4,0,9,14,
28,10,0,0,129,0,193,128,193,128,193,128,193,128,125,128,
61,128,1,128,1,128,1,128,193,128,225,128,127,0,62,0,
10,14,28,11,0,0,63,0,127,128,237,192,204,192,204,192,
237,192,109,128,45,0,12,0,12,0,12,0,12,0,12,0,
4,0,9,14,28,10,0,0,193,128,193,128,193,128,99,0,
99,0,50,0,56,0,28,0,14,0,103,0,99,0,193,128,
193,128,193,128,10,15,30,10,0,255,130,0,195,0,195,0,
195,0,195,0,195,0,195,0,195,0,195,0,195,0,195,0,
195,0,223,0,223,128,1,192,9,14,28,10,0,0,129,0,
193,128,193,128,193,128,193,128,193,128,225,128,125,128,61,128,
1,128,1,128,1,128,1,128,0,128,10,14,28,11,0,0,
128,128,192,192,192,192,192,192,200,192,204,192,204,192,204,192,
204,192,204,192,196,192,192,64,223,128,95,192,11,15,30,11,
0,255,128,128,192,192,192,192,192,192,200,192,204,192,204,192,
204,192,204,192,204,192,196,192,192,64,223,128,95,192,0,224,
9,14,28,10,0,0,224,0,224,0,96,0,96,0,96,0,
96,0,110,0,111,0,99,128,97,128,97,128,99,128,127,0,
62,0,10,14,28,11,0,0,128,128,192,192,192,192,192,192,
192,192,192,192,220,192,222,192,199,64,195,64,195,64,199,64,
254,192,124,192,9,14,28,10,0,0,128,0,192,0,192,0,
192,0,192,0,192,0,222,0,223,0,195,128,193,128,193,128,
195,128,255,0,254,0,9,14,28,10,0,0,62,0,127,0,
227,128,193,128,193,128,1,128,29,128,29,128,1,128,1,128,
193,128,227,128,127,0,62,0,10,14,28,11,0,0,71,0,
207,128,221,192,216,192,216,192,216,192,248,192,248,192,216,192,
216,192,216,192,221,192,207,128,135,0,9,14,28,10,0,0,
63,128,127,128,225,128,193,128,193,128,225,128,125,128,61,128,
29,128,57,128,113,128,225,128,193,128,129,0,8,11,11,9,
0,0,124,127,3,3,59,123,227,195,199,255,123,8,11,11,
9,0,0,7,31,56,112,102,207,195,195,231,126,60,8,11,
11,9,0,0,92,222,198,198,220,222,195,195,199,222,188,8,
11,11,9,0,0,254,255,192,192,192,192,192,192,192,192,128,
10,11,22,11,0,0,31,128,31,128,25,128,49,128,49,128,
49,128,1,128,127,192,255,192,192,192,192,192,8,11,11,9,
0,0,60,126,231,195,195,223,222,192,227,127,62,9,11,22,
10,0,0,64,128,201,128,201,128,107,0,54,0,54,0,107,
0,201,128,201,128,201,128,129,0,8,11,11,9,0,0,116,
246,195,7,126,62,6,3,7,254,124,8,11,11,9,0,0,
65,195,195,199,207,223,219,211,195,195,130,8,11,11,9,0,
0,89,219,211,199,207,223,219,211,195,195,130,8,11,11,9,
0,0,71,207,204,220,216,216,216,220,206,199,67,8,11,11,
9,0,0,27,59,115,227,195,195,195,195,195,195,195,9,11,
22,10,0,0,65,0,227,128,247,128,247,128,213,128,213,128,
213,128,213,128,193,128,193,128,129,0,8,11,11,9,0,0,
65,195,195,251,251,195,195,195,195,195,130,8,11,11,9,0,
0,52,118,227,195,195,195,195,195,227,118,52,8,11,11,9,
0,0,95,223,195,195,195,195,195,195,195,195,130,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255};
Выкладывать надо по правилам форума
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 14:36
#31
DAFdriver
Offline
Зарегистрирован: 12.08.2016
Извиняюсь это мое первое сообщение.
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 19:27
#32
Jeka_M

Offline
Зарегистрирован: 06.07.2014
DAFdriver пишет:
И сразу проблемка — неполучается прошить arduino nano .
Информации недостаточно. Расшифруйте подробно ваше «неполучается прошить».
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 19:42
#33
DAFdriver
Offline
Зарегистрирован: 12.08.2016
Пишет ошибка компиляции
Arduino: 1.8.1 (Windows 7), Плата:»Arduino Nano, ATmega328″
C:Program Files (x86)ArduinolibrariesDDS_sweeper1_TFT_ST7735_128x160_v4_hwspiDDS_sweeper1_TFT_ST7735_128x160_v4_hwspi.ino:18:20: fatal error: Ucglib.h: No such file or directory
#include «Ucglib.h»
^
compilation terminated.
exit status 1
Ошибка компиляции для платы Arduino Nano.
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
«Показать подробный вывод во время компиляции»
вот сподключеной ардуиной
Arduino: 1.8.1 (Windows 7), Плата:»Arduino Nano, ATmega328″
C:Program Files (x86)ArduinolibrariesDDS_sweeper1_TFT_ST7735_128x160_v4_hwspiDDS_sweeper1_TFT_ST7735_128x160_v4_hwspi.ino:18:20: fatal error: Ucglib.h: No such file or directory
#include «Ucglib.h»
^
compilation terminated.
exit status 1
Ошибка компиляции для платы Arduino Nano.
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariesad9850adafuilt: C:Program Files (x86)Arduinolibrariesad9850adafuilt
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT-Shield-Example-Code-master: C:Program Files (x86)ArduinolibrariesTFT-Shield-Example-Code-master
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT_Touch_Shield: C:Program Files (x86)ArduinolibrariesTFT_Touch_Shield
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTSCalibration: C:Program Files (x86)ArduinolibrariesTSCalibration
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariesad9850adafuilt: C:Program Files (x86)Arduinolibrariesad9850adafuilt
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT-Shield-Example-Code-master: C:Program Files (x86)ArduinolibrariesTFT-Shield-Example-Code-master
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT_Touch_Shield: C:Program Files (x86)ArduinolibrariesTFT_Touch_Shield
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTSCalibration: C:Program Files (x86)ArduinolibrariesTSCalibration
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
«Показать подробный вывод во время компиляции»
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 19:41
#34
vovan_UA
Offline
Зарегистрирован: 27.05.2017
ну а с моими ошибками кто подскажет что делать если это возможно конечно
Скетч использует 21464 байт (69%) памяти устройства. Всего доступно 30720 байт.
Глобальные переменные используют 977 байт (47%) динамической памяти, оставляя 1071 байт для локальных переменных. Максимум: 2048 байт.
avrdude: verification error, first mismatch at byte 0x0042
0xf1 != 0x1d
avrdude: verification error; content mismatch
avrdude: verification error; content mismatch
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 20:40
#35
T.Rook
Offline
Зарегистрирован: 05.03.2016
DAFdriver пишет:
DDS_sweeper1_TFT_ST7735_128x160_v4_hwspi.ino:18:20: fatal error: Ucglib.h: No such file or directory
#include «Ucglib.h»
нет бибиотеки (или не найдена) Ucglib.h. Т.к. в скетче написано «Ucglib.h» то библтотека ожидается в каталоге файла «.ino». Если библиотека лежит в libraries, то исправьте на: #include <Ucglib.h>
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 20:49
#36
T.Rook
Offline
Зарегистрирован: 05.03.2016
vovan_UA пишет:
ну а с моими ошибками кто подскажет что делать если это возможно конечно
avrdude: verification error, first mismatch at byte 0x0042
0xf1 != 0x1d
Если Вы полностью исключаете сбои по питанию (и ресету), и ошибка всегда на одном месте (на разных скетчах) «first mismatch at byte 0x0042» — то в мусор 
UPD: хотя ВОТ написано что подобное было из-за драйвера
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 20:54
#37
vovan_UA
Offline
Зарегистрирован: 27.05.2017
Да вот как раз ошибка всегда на одном месте а так врди загрузка проходит нормально единственое при проверке и возникает эта ошибка а загрузчик не мог слететь случайно или это уже самой памяти гаплык просто это пошло после ппытки загрузить скетч при помощи XLoader хотя рание было все нормально
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 21:04
#38
T.Rook
Offline
Зарегистрирован: 05.03.2016
vovan_UA пишет:
Да вот как раз ошибка всегда на одном месте а так врди загрузка проходит нормально единственое при проверке и возникает эта ошибка а загрузчик не мог слететь случайно или это уже самой памяти гаплык просто это пошло после ппытки загрузить скетч при помощи XLoader хотя рание было все нормально
Это легко проверить: пробовали перезаписать загрузчик?
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 21:15
#39
qwone

Offline
Зарегистрирован: 03.07.2016
DAFdriver
Ucglib.h: No such file or directory // нет файла в директории
#include "Ucglib.h"
^ //<--а вот вам стрелочкой компилятор показывает
compilation terminated.
Нельзя же быть таким безголовым
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 21:15
#40
DAFdriver
Offline
Зарегистрирован: 12.08.2016
Так что на чтои где исправить.Я в этом деле зеленый бегемот.
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 21:22
#41
qwone

Offline
Зарегистрирован: 03.07.2016
#include "Ucglib.h" //<-это можно найти здесь https://code.google.com/p/ucglib/ * #include "rusFont.h" //<- а вот это хер знает где и не беритесь за сложные проекты это вам не игры на планшет заливать
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 21:47
#42
DAFdriver
Offline
Зарегистрирован: 12.08.2016
Спасибо буду пытаться. На счет игр мне 56лет ,я ими не занимаюсь . Занимаюсь настройкой CI-Bi антенн и ремонтом радиостанций , устанавливааю и обслуживаю пожарные , охранные сигнализации и видео наблюдение. Там приходится пршивать датчики и приборы , нотам все проще .
- Войдите на сайт для отправки комментариев
Вс, 28/05/2017 — 21:58
#43
vovan_UA
Offline
Зарегистрирован: 27.05.2017
T.Rook пишет:
Это легко проверить: пробовали перезаписать загрузчик?
Не пробовал просто незнаю как с таким столкнулся в первые а из самой среды не получается выдает ошибку пробовал и при помощи USBASP он ее вобще отказывается видить а этот PL2303HX видит ну так же выдает шибку а как ещо просто незна есть ещо в наличие R3 MEGA328P ATMEGA16U2 со сьемной микрухой ну вот как к нему правильно подключится найти не могу
- Войдите на сайт для отправки комментариев
Пнд, 29/05/2017 — 00:48
#44
T.Rook
Offline
Зарегистрирован: 05.03.2016
vovan_UA пишет:
Не пробовал просто незнаю как с таким столкнулся в первые а из самой среды не получается выдает ошибку пробовал и при помощи USBASP он ее вобще отказывается видить а этот PL2303HX видит ну так же выдает шибку а как ещо просто незна есть ещо в наличие R3 MEGA328P ATMEGA16U2 со сьемной микрухой ну вот как к нему правильно подключится найти не могу
Легко гуглится по «arduino isp программатор».
В качестве немного бредовой идеи на «поискать и почитать много непонятного»: если вылетела одна ячейка, то, наверное. можно натйти опции компиляции HEX файла, что бы рабочий код начинался после сбойного адреса. Может кто подскажет vovan_UA?
- Войдите на сайт для отправки комментариев
Пнд, 29/05/2017 — 07:30
#45
vovan_UA
Offline
Зарегистрирован: 27.05.2017
T.Rook пишет:
UPD: хотя ВОТ написано что подобное было из-за драйвера
Ну с драйверами тут все в порядке прост у меня таких платок несколько и в другую все записалось без проблем а с этой непонятка такая и такое ощущение что прсто предыдущая прошивка сидит внутри и невкаку не хочет затираться
- Войдите на сайт для отправки комментариев
Пнд, 29/05/2017 — 08:57
#46
ua6em

Онлайн
Зарегистрирован: 17.08.2016
qwone пишет:
#include "rusFont.h" //<- а вот это хер знает где
А это разве не оно?
Добавить в проект файлик с этим имененм и содержимое в этот файл разместить, или я что-то путаю???
const ucg_fntpgm_uint8_t my14x10rus[4157] UCG_SECTION(«.progmem.my14x10») = {
0,11,15,0,255,14,3,35,6,248,32,255,0,15,255,14,……………………………….
Файлик «rusFont.h» — файлик должен лежать в каталоге со скетчем
const ucg_fntpgm_uint8_t my14x10rus[4157] UCG_SECTION(".progmem.my14x10") = {
0,11,15,0,255,14,3,35,6,248,32,255,0,15,255,14,
0,0,0,0,8,0,0,2,14,14,4,1,0,64,192,192,
192,192,192,192,192,192,128,0,64,192,128,6,5,5,7,0,
9,68,204,204,204,136,10,14,28,11,0,0,8,128,8,128,
17,0,17,0,127,192,17,0,17,0,34,0,34,0,255,128,
34,0,34,0,68,0,68,0,9,14,28,10,0,0,8,0,
8,0,59,128,123,0,200,0,200,0,232,0,107,0,11,128,
9,128,9,128,111,0,238,0,8,0,8,14,14,9,0,0,
97,179,214,102,12,12,24,24,48,48,102,107,205,134,9,14,
28,10,0,0,56,0,124,0,108,0,108,0,108,0,56,0,
56,128,109,128,199,0,194,0,199,0,237,128,124,128,56,0,
2,5,5,3,0,10,128,192,192,192,64,5,14,14,6,0,
0,24,48,96,96,192,192,192,192,192,192,96,96,48,24,5,
14,14,6,0,0,192,96,48,48,24,24,24,24,24,24,56,
48,96,192,7,7,7,8,0,4,146,214,124,16,124,214,146,
8,10,10,10,0,1,8,24,24,24,127,254,24,24,24,16,
4,6,6,5,0,0,112,96,96,64,192,192,8,2,2,9,
0,5,127,254,3,3,3,4,0,0,224,160,224,8,14,14,
9,0,0,3,3,6,6,12,12,24,24,48,48,96,96,192,
192,9,14,28,10,0,0,62,0,127,0,227,128,197,128,197,
128,197,128,201,128,201,128,209,128,209,128,209,128,227,128,127,
0,62,0,9,14,28,10,0,0,12,0,28,0,60,0,124,
0,8,0,4,0,12,0,12,0,8,0,4,0,12,0,12,
0,127,128,255,128,9,14,28,10,0,0,126,0,255,0,195,
128,193,128,1,128,3,128,63,0,126,0,224,0,192,0,192,
0,192,0,223,128,191,0,9,14,28,10,0,0,126,0,255,
0,195,128,1,128,1,128,3,0,58,0,119,0,3,128,1,
128,1,128,3,128,255,0,126,0,9,14,28,10,0,0,2,
0,6,0,14,0,30,0,62,0,118,0,230,0,198,0,251,
128,247,0,6,0,6,0,6,0,4,0,9,14,28,10,0,
0,127,128,127,128,96,0,96,0,96,0,110,0,111,0,3,
128,1,128,1,128,1,128,195,0,255,0,124,0,9,14,28,
10,0,0,31,0,127,0,96,0,192,0,192,0,192,0,222,
0,223,0,195,128,193,128,193,128,227,0,127,0,60,0,9,
14,28,10,0,0,127,128,255,128,0,0,3,0,3,0,6,
0,6,0,12,0,12,0,24,0,24,0,48,0,48,0,32,
0,9,14,28,10,0,0,58,0,119,0,227,128,193,128,193,
128,99,0,54,0,111,0,227,128,193,128,193,128,227,128,119,
0,46,0,9,14,28,10,0,0,60,0,255,0,231,0,195,
128,193,128,193,128,225,128,253,128,125,128,1,128,3,128,7,
0,127,0,252,0,3,11,11,4,0,2,224,160,224,0,0,
0,0,0,224,160,224,4,13,13,5,0,0,112,80,112,0,
0,0,0,0,112,80,112,96,192,9,11,22,10,0,1,1,
128,3,128,15,0,28,0,120,0,224,0,120,0,28,0,15,
0,3,128,1,128,9,6,12,10,0,4,127,128,255,0,0,
0,0,0,127,128,255,0,9,11,22,10,0,1,192,0,224,
0,120,0,60,0,15,0,3,128,15,0,60,0,120,0,224,
0,192,0,8,14,14,9,0,0,116,238,135,3,3,6,14,
56,48,48,0,0,48,48,9,11,22,10,0,1,62,0,65,
0,128,128,154,128,166,128,162,128,162,128,166,128,155,0,64,
0,63,128,9,14,28,10,0,0,252,0,254,0,199,0,195,
128,193,128,193,128,193,128,253,128,253,128,193,128,193,128,193,
128,193,128,129,0,9,14,28,10,0,0,94,0,223,0,195,
128,193,128,193,128,195,128,255,0,255,0,195,128,193,128,193,
128,195,128,223,0,190,0,9,14,28,10,0,0,14,0,63,
0,115,128,97,128,192,0,192,0,192,0,192,0,192,0,192,
0,96,0,112,0,63,128,15,0,9,14,28,10,0,0,238,
0,111,0,99,128,97,128,97,128,97,128,97,128,97,128,97,
128,97,128,97,128,99,128,111,0,238,0,9,14,28,10,0,
0,95,128,223,0,192,0,192,0,192,0,192,0,223,0,222,
0,192,0,192,0,192,0,192,0,223,128,191,0,9,14,28,
10,0,0,95,128,223,0,192,0,192,0,192,0,192,0,223,
0,222,0,192,0,192,0,192,0,192,0,192,0,128,0,9,
14,28,10,0,0,63,128,127,128,225,128,192,0,192,0,192,
0,192,0,207,128,223,128,193,128,193,128,225,128,127,128,62,
0,9,14,28,10,0,0,129,0,193,128,193,128,193,128,193,
128,193,128,223,128,223,128,193,128,193,128,193,128,193,128,193,
128,64,128,8,14,14,10,1,0,254,127,24,24,24,24,24,
24,24,24,24,24,254,127,9,14,28,10,0,0,31,128,63,
128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,
128,1,128,195,128,255,0,62,0,9,14,28,10,0,0,65,
128,195,128,199,0,206,0,220,0,216,0,216,0,216,0,216,
0,220,0,206,0,199,0,195,128,65,128,9,14,28,10,0,
0,64,0,192,0,192,0,192,0,192,0,192,0,192,0,192,
0,192,0,192,0,192,0,192,0,255,128,255,0,9,14,28,
10,0,0,193,128,227,128,247,128,247,128,213,128,193,128,213,
128,221,128,221,128,201,128,193,128,193,128,193,128,129,0,9,
14,28,10,0,0,225,0,225,128,241,128,241,128,249,128,217,
128,221,128,205,128,205,128,197,128,197,128,193,128,193,128,128,
128,9,14,28,10,0,0,46,0,111,0,227,128,193,128,193,
128,193,128,193,128,193,128,193,128,193,128,193,128,227,128,123,
0,58,0,9,14,28,10,0,0,254,0,255,0,195,128,193,
128,193,128,195,128,223,0,222,0,192,0,192,0,192,0,192,
0,192,0,128,0,10,15,30,10,0,255,46,0,111,0,227,
128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,
128,227,0,123,128,58,192,0,192,9,14,28,10,0,0,126,
0,255,0,195,128,193,128,193,128,195,128,223,0,220,0,206,
0,199,0,195,128,193,128,193,128,129,0,9,14,28,10,0,
0,62,0,127,0,224,0,192,0,192,0,224,0,118,0,27,
0,3,128,1,128,1,128,3,128,255,128,127,0,9,14,28,
10,0,0,255,0,127,128,0,0,12,0,12,0,12,0,12,
0,12,0,12,0,12,0,12,0,12,0,12,0,4,0,9,
14,28,10,0,0,64,128,193,128,193,128,193,128,193,128,193,
128,193,128,193,128,193,128,193,128,193,128,99,0,127,0,62,
0,9,14,28,10,0,0,227,128,99,0,99,0,99,0,34,
0,54,0,54,0,54,0,20,0,28,0,28,0,28,0,8,
0,8,0,10,14,28,11,0,0,64,64,192,192,192,192,192,
192,192,192,192,192,204,192,204,192,204,192,222,192,222,192,211,
192,193,192,128,192,9,14,28,10,0,0,193,128,193,128,193,
128,99,0,99,0,50,0,56,0,28,0,14,0,103,0,99,
0,193,128,193,128,193,128,10,14,28,10,0,0,192,192,192,
192,97,128,97,128,51,0,63,0,30,0,12,0,8,0,4,
0,12,0,12,0,12,0,8,0,9,14,28,10,0,0,127,
128,255,128,1,128,3,128,7,0,6,0,4,0,16,0,48,
0,112,0,224,0,192,0,255,128,255,0,5,14,14,6,0,
0,248,192,192,192,192,192,192,192,192,192,192,192,192,248,9,
14,28,10,0,0,192,0,96,0,96,0,48,0,48,0,24,
0,24,0,12,0,12,0,6,0,6,0,3,0,3,0,1,
128,5,14,14,6,0,0,248,24,24,24,24,24,24,24,24,
24,24,24,24,248,9,6,12,10,0,8,8,0,28,0,54,
0,99,0,193,128,128,128,10,1,2,10,0,255,255,192,4,
3,3,5,0,12,224,96,48,8,11,11,9,0,0,124,127,
3,3,59,123,227,195,199,255,123,9,13,26,10,0,0,64,
0,192,0,192,0,192,0,192,0,222,0,223,0,195,128,193,
128,193,128,195,0,255,0,222,0,8,11,11,9,0,0,30,
63,115,224,192,192,192,224,240,127,30,9,13,26,10,0,0,
0,128,1,128,1,128,1,128,1,128,61,128,125,128,225,128,
193,128,193,128,227,128,127,128,61,128,8,11,11,9,0,0,
60,126,231,195,195,223,222,192,227,127,62,7,13,13,8,0,
0,62,124,96,96,252,248,96,96,96,96,96,96,32,8,13,
13,9,0,0,63,127,227,195,195,195,227,123,51,3,3,127,
254,8,13,13,9,0,0,64,192,192,192,222,223,195,195,195,
195,195,195,130,2,13,13,3,0,0,64,192,128,64,192,192,
192,192,192,192,192,192,128,5,14,14,6,0,255,16,24,24,
8,48,120,24,24,24,24,24,24,120,240,8,13,13,9,0,
0,64,192,192,198,198,204,216,216,216,204,198,199,131,2,14,
14,3,0,0,64,192,192,192,192,192,192,192,192,192,192,192,
192,128,9,11,22,10,0,0,91,0,219,128,201,128,201,128,
201,128,201,128,201,128,201,128,201,128,193,128,129,0,8,11,
11,9,0,0,94,223,195,195,195,195,195,195,195,195,130,8,
11,11,9,0,0,52,118,227,195,195,195,195,195,227,118,52,
8,11,11,9,0,0,252,254,199,195,199,222,220,192,192,192,
128,9,13,26,9,0,255,63,0,127,0,227,0,195,0,195,
0,195,0,251,0,123,0,3,0,3,0,3,128,3,128,3,
128,7,11,11,8,0,0,92,222,224,224,192,192,192,192,192,
192,128,8,11,11,9,0,0,62,127,192,192,240,102,15,3,
3,254,124,6,13,13,7,0,0,32,96,96,252,248,96,96,
96,96,96,96,124,60,8,11,11,9,0,0,65,195,195,195,
195,195,195,195,227,123,58,8,11,11,9,0,0,129,129,195,
195,102,102,102,36,60,24,24,9,11,22,10,0,0,128,128,
193,128,201,128,201,128,201,128,201,128,193,128,221,128,247,128,
227,128,65,0,8,11,11,9,0,0,195,102,102,52,24,24,
24,52,102,102,195,8,12,12,9,0,255,193,227,99,102,110,
44,12,24,24,48,240,224,8,11,11,9,0,0,127,255,7,
6,12,0,48,96,224,255,254,7,14,14,8,0,0,14,28,
24,24,24,48,224,224,48,24,24,24,28,14,2,16,16,5,
1,255,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,8,14,14,9,0,0,224,112,24,24,24,12,7,7,
12,24,24,24,112,224,10,5,10,11,0,4,48,192,120,192,
204,192,199,128,195,0,5,13,13,6,0,1,248,136,136,136,
136,136,136,136,136,136,136,136,248,8,11,11,9,0,0,252,
254,199,195,199,222,220,192,192,192,128,8,11,11,9,0,0,
30,63,115,224,192,192,192,224,240,127,30,8,11,11,9,0,
0,127,254,24,24,24,24,24,24,24,24,16,8,12,12,9,
0,255,193,227,99,102,110,44,12,24,24,48,240,224,8,12,
12,9,0,255,126,255,219,219,219,219,90,24,24,24,24,16,
8,11,11,9,0,0,195,102,102,52,24,24,24,52,102,102,
195,8,12,12,9,0,255,132,198,198,198,198,198,198,198,198,
254,255,3,8,11,11,9,0,0,65,195,195,195,231,127,63,
3,3,3,2,8,11,11,9,0,0,130,195,195,211,219,219,
219,219,219,203,255,8,12,12,9,0,255,130,195,195,211,219,
219,219,219,218,200,255,3,8,11,11,9,0,0,192,224,96,
96,108,110,103,99,103,126,124,8,11,11,9,0,0,130,195,
195,195,219,221,207,199,207,253,251,8,11,11,9,0,0,64,
192,192,192,220,222,199,195,199,254,252,8,11,11,9,0,0,
124,254,198,3,27,59,3,3,6,254,120,9,11,22,10,0,
0,71,0,207,128,205,128,205,128,221,128,221,128,205,128,205,
128,205,128,207,128,135,0,8,11,11,9,0,0,63,127,227,
195,227,123,59,51,51,115,226,9,14,28,10,0,0,252,0,
254,0,199,0,195,128,193,128,193,128,193,128,253,128,253,128,
193,128,193,128,193,128,193,128,129,0,9,14,28,10,0,0,
223,128,223,0,192,0,192,0,192,0,192,0,222,0,223,0,
195,128,193,128,193,128,195,128,255,0,254,0,9,14,28,10,
0,0,94,0,223,0,195,128,193,128,193,128,195,128,255,0,
255,0,195,128,193,128,193,128,195,128,223,0,190,0,9,14,
28,10,0,0,223,0,223,128,192,0,192,0,192,0,192,0,
192,0,192,0,192,0,192,0,192,0,192,0,192,0,128,0,
9,14,28,10,0,0,11,0,27,0,59,0,115,0,99,0,
99,0,99,0,99,0,99,0,99,0,123,0,251,128,193,128,
193,128,9,14,28,10,0,0,95,128,223,0,192,0,192,0,
192,0,192,0,223,0,222,0,192,0,192,0,192,0,192,0,
223,128,191,0,10,14,28,11,0,0,64,64,192,192,196,192,
204,192,204,192,109,128,109,128,109,128,109,128,204,192,204,192,
204,192,200,192,128,128,9,14,28,10,0,0,122,0,251,0,
131,128,1,128,1,128,3,0,58,0,123,0,3,128,1,128,
1,128,131,128,251,0,120,0,9,14,28,10,0,0,67,128,
195,128,199,128,199,128,199,128,205,128,205,128,205,128,217,128,
217,128,217,128,209,128,209,128,193,0,9,14,28,10,0,0,
91,128,219,128,215,128,199,128,199,128,205,128,205,128,205,128,
217,128,217,128,217,128,209,128,209,128,193,0,9,14,28,10,
0,0,65,128,195,128,199,0,206,0,220,0,216,0,216,0,
216,0,216,0,220,0,206,0,199,0,195,128,65,128,9,14,
28,10,0,0,220,0,222,0,199,0,195,128,193,128,193,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
9,14,28,10,0,0,193,128,227,128,247,128,247,128,213,128,
193,128,213,128,221,128,221,128,201,128,193,128,193,128,193,128,
129,0,9,14,28,10,0,0,129,0,193,128,193,128,193,128,
193,128,193,128,223,128,223,128,193,128,193,128,193,128,193,128,
193,128,64,128,9,14,28,10,0,0,46,0,111,0,227,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
227,128,123,0,58,0,9,14,28,10,0,0,223,128,223,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
193,128,193,128,193,128,129,0,9,14,28,10,0,0,254,0,
255,0,195,128,193,128,193,128,195,128,223,0,222,0,192,0,
192,0,192,0,192,0,192,0,128,0,9,14,28,10,0,0,
14,0,63,0,115,128,97,128,192,0,192,0,192,0,192,0,
192,0,192,0,96,0,112,0,63,128,15,0,9,14,28,10,
0,0,255,0,127,128,0,0,12,0,12,0,12,0,12,0,
12,0,12,0,12,0,12,0,12,0,12,0,4,0,9,14,
28,10,0,0,129,0,193,128,193,128,193,128,193,128,125,128,
61,128,1,128,1,128,1,128,193,128,225,128,127,0,62,0,
10,14,28,11,0,0,63,0,127,128,237,192,204,192,204,192,
237,192,109,128,45,0,12,0,12,0,12,0,12,0,12,0,
4,0,9,14,28,10,0,0,193,128,193,128,193,128,99,0,
99,0,50,0,56,0,28,0,14,0,103,0,99,0,193,128,
193,128,193,128,10,15,30,10,0,255,130,0,195,0,195,0,
195,0,195,0,195,0,195,0,195,0,195,0,195,0,195,0,
195,0,223,0,223,128,1,192,9,14,28,10,0,0,129,0,
193,128,193,128,193,128,193,128,193,128,225,128,125,128,61,128,
1,128,1,128,1,128,1,128,0,128,10,14,28,11,0,0,
128,128,192,192,192,192,192,192,200,192,204,192,204,192,204,192,
204,192,204,192,196,192,192,64,223,128,95,192,11,15,30,11,
0,255,128,128,192,192,192,192,192,192,200,192,204,192,204,192,
204,192,204,192,204,192,196,192,192,64,223,128,95,192,0,224,
9,14,28,10,0,0,224,0,224,0,96,0,96,0,96,0,
96,0,110,0,111,0,99,128,97,128,97,128,99,128,127,0,
62,0,10,14,28,11,0,0,128,128,192,192,192,192,192,192,
192,192,192,192,220,192,222,192,199,64,195,64,195,64,199,64,
254,192,124,192,9,14,28,10,0,0,128,0,192,0,192,0,
192,0,192,0,192,0,222,0,223,0,195,128,193,128,193,128,
195,128,255,0,254,0,9,14,28,10,0,0,62,0,127,0,
227,128,193,128,193,128,1,128,29,128,29,128,1,128,1,128,
193,128,227,128,127,0,62,0,10,14,28,11,0,0,71,0,
207,128,221,192,216,192,216,192,216,192,248,192,248,192,216,192,
216,192,216,192,221,192,207,128,135,0,9,14,28,10,0,0,
63,128,127,128,225,128,193,128,193,128,225,128,125,128,61,128,
29,128,57,128,113,128,225,128,193,128,129,0,8,11,11,9,
0,0,124,127,3,3,59,123,227,195,199,255,123,8,11,11,
9,0,0,7,31,56,112,102,207,195,195,231,126,60,8,11,
11,9,0,0,92,222,198,198,220,222,195,195,199,222,188,8,
11,11,9,0,0,254,255,192,192,192,192,192,192,192,192,128,
10,11,22,11,0,0,31,128,31,128,25,128,49,128,49,128,
49,128,1,128,127,192,255,192,192,192,192,192,8,11,11,9,
0,0,60,126,231,195,195,223,222,192,227,127,62,9,11,22,
10,0,0,64,128,201,128,201,128,107,0,54,0,54,0,107,
0,201,128,201,128,201,128,129,0,8,11,11,9,0,0,116,
246,195,7,126,62,6,3,7,254,124,8,11,11,9,0,0,
65,195,195,199,207,223,219,211,195,195,130,8,11,11,9,0,
0,89,219,211,199,207,223,219,211,195,195,130,8,11,11,9,
0,0,71,207,204,220,216,216,216,220,206,199,67,8,11,11,
9,0,0,27,59,115,227,195,195,195,195,195,195,195,9,11,
22,10,0,0,65,0,227,128,247,128,247,128,213,128,213,128,
213,128,213,128,193,128,193,128,129,0,8,11,11,9,0,0,
65,195,195,251,251,195,195,195,195,195,130,8,11,11,9,0,
0,52,118,227,195,195,195,195,195,227,118,52,8,11,11,9,
0,0,95,223,195,195,195,195,195,195,195,195,130,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255};
- Войдите на сайт для отправки комментариев
Пнд, 29/05/2017 — 10:09
#47
DAFdriver
Offline
Зарегистрирован: 12.08.2016
Так он там есть , может не правильный . пост 29 .
- Войдите на сайт для отправки комментариев
Пнд, 29/05/2017 — 10:12
#48
ua6em

Онлайн
Зарегистрирован: 17.08.2016
DAFdriver пишет:
Так он там есть , может не правильный . пост 29 .
не в скетче, а в отдельном файле, точно есть? и имя файла соответствует? сомневаюсь )))
- Войдите на сайт для отправки комментариев
Пнд, 29/05/2017 — 11:39
#49
DAFdriver
Offline
Зарегистрирован: 12.08.2016
Да в отдельной папке . В ide на белом фоне DDS_sveper1_TFT_ST7735_128X160_V4hvspi рядом на синем фоне rusFont.h и далее
/***************************************************************************
* Name : DDS_Sweeper.BAS *
* Author : Beric Dunn (K6BEZ) *
* Notice : Copyright (c) 2013 CC-BY-SA *
* : Creative Commons Attribution-ShareAlike 3.0 Unported License *
* Date : 9/26/2013 *
* Version : 1.0 *
* Notes : Written using for the Arduino Micro *
* : Pins: *
* : A0 — Reverse Detector Analog in *
* : A1 — Forward Detector Analog in *
* : Modified by Norbert Redeker (DG7EAO) 07/2014 *
* : TFT Display mit ILI9341 Chip, SPI, 240 x 320 *
***************************************************************************/
#include <SPI.h>
#include «Ucglib.h»
#include «rusFont.h»
// Define Pins used to control AD9850 DDS
const int FQ_UD=9;
const int SDAT=7;
const int SCLK=10;
const int RESET=12;
// Variablen für Display
double vswrArray[110]; //Array für SWR
int z = 0; // Index für Array
double SwrFreq = 14; // Variable für Freq. mit SWR Min.
double SwrMin = 100; // Variable für SWR Min.
double Freq1 = 1; // Freq. Links unterste Zeile Display
double Freq2 = 15; // Freq. Mitte unterste Zeile Display
double Freq3 = 30; // Freq. Mitte unterste Zeile Display
unsigned long milliold = 0; //Millisekunden für Entprellung Interrupt
unsigned long millinew = 0; //Millisekunden für Entprellung Interrupt
int flag = 0; // wir auf 1 gesetzt bei Interrupt, in void Loop perform_sweep
double counter = 0; // Zähler um erste Interrupts zu ignorieren
// Variablen für Messung
double Fstart_MHz = 1; // Start Frequency for sweep
double Fstop_MHz = 30; // Stop Frequency for sweep
double current_freq_MHz; // Temp variable used during sweep
long serial_input_number; // Used to build number from serial stream
int num_steps = 100; // Number of steps to use in the sweep
char incoming_char; // Character read from serial stream
//Konstruktor für Display
Ucglib_ST7735_18x128x160_HWSPI ucg(/*cd=*/ 6 , /*cs=*/ 5, /*reset=*/ 4);
// the setup routine runs once when you press reset:
void setup() {
// Voltmetr
analogReference(INTERNAL);
float Vbat = (analogRead(A5) * 1.1) / 1023.0;
float Vin = Vbat / (89.8 / (783.0 + 89.8)); // R2/(R1+R2)
// Schreibe Info Text auf Display
ucg.begin(UCG_FONT_MODE_SOLID);
ucg.clearScreen();
ucg.setRotate90();
ucg.setFont(my14x10rus);
ucg.setColor(255, 255, 255);
ucg.setPrintPos(32,25);
ucg.print(«Панорамный»);
ucg.setPrintPos(40,45);
ucg.print(«КСВ Метр»);
ucg.setPrintPos(40,65);
ucg.print(«1-30 MHz»);
ucg.setPrintPos(32,90);
ucg.print(«Пенза 2016»);
ucg.setPrintPos(5,128);
ucg.print(«Бат «);
ucg.setPrintPos(40,128);
ucg.print(Vin, 1);
// Configiure DDS control pins for digital output
pinMode(FQ_UD,OUTPUT);
pinMode(SCLK,OUTPUT);
pinMode(SDAT,OUTPUT);
pinMode(RESET,OUTPUT);
//Tasten Interrupt an PIN 2
pinMode(2,OUTPUT);
digitalWrite(2, HIGH);
attachInterrupt(0, key2, FALLING);
unsigned long milliold = millis();
//Tasten Interrupt an PIN 3
pinMode(3,OUTPUT);
digitalWrite(3, HIGH);
attachInterrupt(1, key3, FALLING);
//milliold = millis();
// Configure LED pin for digital output
pinMode(13,OUTPUT);
// Set up analog inputs on A0 and A1, internal reference voltage
pinMode(A0,INPUT);
pinMode(A1,INPUT);
analogReference(INTERNAL);
// initialize serial communication at 57600 baud
Serial.begin(57600);
// Reset the DDS
digitalWrite(RESET,HIGH);
digitalWrite(RESET,LOW);
//Initialise the incoming serial number to zero
serial_input_number=0;
}
// the loop routine runs over and over again forever:
void loop() {
//Check for character
if(Serial.available()>0){
incoming_char = Serial.read();
switch(incoming_char){
case ‘0’:
case ‘1’:
case ‘2’:
case ‘3’:
case ‘4’:
case ‘5’:
case ‘6’:
case ‘7’:
case ‘8’:
case ‘9’:
serial_input_number=serial_input_number*10+(incoming_char-‘0’);
break;
case ‘A’:
//Turn frequency into FStart
Fstart_MHz = ((double)serial_input_number)/1000000;
serial_input_number=0;
break;
case ‘B’:
//Turn frequency into FStop
Fstop_MHz = ((double)serial_input_number)/1000000;
serial_input_number=0;
break;
case ‘C’:
//Turn frequency into FStart and set DDS output to single frequency
Fstart_MHz = ((double)serial_input_number)/1000000;
//SetDDSFreq(Fstart_MHz);
SetDDSFreq(Fstart_MHz * 1000000);
delay(100);
SetDDSFreq(Fstart_MHz * 1000000);
serial_input_number=0;
break;
case ‘N’:
// Set number of steps in the sweep
num_steps = serial_input_number;
serial_input_number=0;
break;
case ‘S’:
case ‘s’:
Perform_sweep();
break;
case ‘?’:
// Report current configuration to PC
Serial.print(«Start Freq:»);
Serial.println(Fstart_MHz*1000000);
Serial.print(«Stop Freq:»);
Serial.println(Fstop_MHz*1000000);
Serial.print(«Num Steps:»);
Serial.println(num_steps);
break;
}
Serial.flush();
}
//Perform Sweep nach Interrupt PIN2 oder 3
// ingnoriere Startup Interrupts durch counter
if (flag == 1 && counter >2)
{
flag = 0;
Perform_sweep();
}
}
void Perform_sweep(){
double FWD=0;
double REV=0;
double VSWR;
double Fstep_MHz = (Fstop_MHz-Fstart_MHz)/num_steps;
z = 0;
SwrMin = 100;
ucg.clearScreen();
ucg.setFont(my14x10rus);
ucg.setColor(255, 0, 100);
ucg.setPrintPos(35,60);
ucg.print(«Анализ КСВ»);
// Start loop
for(int i=0;i<=num_steps;i++){
// Calculate current frequency
current_freq_MHz = Fstart_MHz + i*Fstep_MHz;
// Set DDS to current frequency
SetDDSFreq(current_freq_MHz*1000000);
// Wait a little for settling
//delay(10);
delay(100);
// Read the forward and reverse voltages
REV = analogRead(A0);
FWD = analogRead(A1);
//Offset Korrektur
REV = REV-5;
if(REV>=FWD){
REV = FWD-1;
}
if (REV <1) {
REV = 1;
}
VSWR = (FWD+REV)/(FWD-REV);
//Skalieren für Ausgabe
VSWR = VSWR * 1000;
// Send current line back to PC over serial bus
Serial.print(current_freq_MHz*1000000);
Serial.print(«,0,»);
Serial.print(VSWR);
Serial.print(«,»);
Serial.print(FWD);
Serial.print(«,»);
Serial.println(REV);
// Übergebe SWR an Array
// ERmittele Freq bei niedrigsten SWR
vswrArray[z] = VSWR/1000;
if (vswrArray[z] > 10) vswrArray[z] = 10;
if (vswrArray[z] < SwrMin && vswrArray[z] > 1)
{
SwrMin = vswrArray[z];
SwrFreq = current_freq_MHz;
}
z = z + 1;
}
// Send «End» to PC to indicate end of sweep
Serial.println(«End»);
Serial.flush();
ucg.clearScreen();
//Zeichne Grid
CreateGrid();
ucg.setColor(76, 255, 0);
// Draw Line
double last = 10;
double xx = 6;
double j = 1;
for (int i = 1 ;i < 103; i++){
xx = vswrArray[i];
ucg.drawLine(j,105-last*9, j+1, 105-xx*9);
ucg.drawLine(j+1,105-last*9, j+2, 105-xx*9);
j = j + 1.5;
last = xx;
}
}
// Setze DDS Frequenz
void SetDDSFreq(double Freq_Hz){
// Calculate the DDS word — from AD9850 Datasheet
int32_t f = Freq_Hz * 4294967295/125000000;
// Send one byte at a time
for (int b=0;b<4;b++,f>>=8){
send_byte(f & 0xFF);
}
// 5th byte needs to be zeros
send_byte(0);
// Strobe the Update pin to tell DDS to use values
digitalWrite(FQ_UD,HIGH);
digitalWrite(FQ_UD,LOW);
}
// Sende Daten an DDS
void send_byte(byte data_to_send){
// Bit bang the byte over the SPI bus
for (int i=0; i<8; i++,data_to_send>>=1){
// Set Data bit on output pin
digitalWrite(SDAT,data_to_send & 0x01);
// Strobe the clock pin
digitalWrite(SCLK,HIGH);
digitalWrite(SCLK,LOW);
}
}
//Zeichne Grid auf TFT Display
void CreateGrid()
{
//ucg.clearScreen();
double maxSwr = 10;
ucg.setFont(ucg_font_5x8);
ucg.drawHLine(0,60,155);
ucg.drawHLine(0,98,155);
ucg.drawVLine(39,15,90);
ucg.drawVLine(78,15,90);
ucg.drawVLine(117,15,90);
ucg.setPrintPos(0, 118);
ucg.print(Freq1,3);
ucg.setPrintPos(65, 118);
ucg.print(Freq2,3);
ucg.setPrintPos(130, 118);
ucg.print(Freq3,3);
ucg.setPrintPos(5, 8);
ucg.print(«SWR»);
ucg.setPrintPos(30, 8);
ucg.print(SwrMin,2);
ucg.setPrintPos(58, 8);
ucg.print(«>»);
ucg.setPrintPos(65, 8);
ucg.print(maxSwr,2);
ucg.setPrintPos(125, 8);
ucg.print(SwrFreq,3);
ucg.drawRFrame(0,15,155,90, 1);
}
// Interrupt Service Routine
// Abfrage Low an Pin 2
void key2()
{
//ignoriere Startup Interrupts > counter
counter = counter + 1;
//Entprellen mit millis()
millinew = millis();
if (millinew — milliold < 1000)
{
milliold = millinew;
return;
}
milliold = millinew;
Fstart_MHz = 1; // Start Frequency for sweep
Fstop_MHz = 30; // Stop Frequency for sweep
num_steps = 102; // Steps
Freq1 = 1; // Unterste Zeile Display Freq. Links
Freq2 = 15; // Unterste Zeile Display Freq. Mitte
Freq3 = 30; // Unterste Zeile Display Freq. Recht
//Perform_sweep();
flag = 1;
}
// Interrupt Service Routine
// Abfrage Low an Pin 3
void key3()
{
//ignoriere Startup Interrupts > counter
counter = counter + 1;
//Entprellen mit millis()
millinew = millis();
if (millinew — milliold < 1000)
{
milliold = millinew;
return;
}
milliold = millinew;
int x = SwrFreq + 0.5; //Runde auf Mhz
Fstart_MHz = x-1; // Start Frequency for sweep
Fstop_MHz = x+1; // Stop Frequency for sweep
num_steps = 102; // Steps
Freq1 = x-1; // Unterste Zeile Display Freq. Links
Freq2 = x; // Unterste Zeile Display Freq. Mitte
Freq3 = x+1; // Unterste Zeile Display Freq. Rechts
//Perform_sweep();
flag = 1;
}
кликаем rusFont.h открывается
const ucg_fntpgm_uint8_t my14x10rus[4157] UCG_SECTION(«.progmem.my14x10») = {
0,11,15,0,255,14,3,35,6,248,32,255,0,15,255,14,
0,0,0,0,8,0,0,2,14,14,4,1,0,64,192,192,
192,192,192,192,192,192,128,0,64,192,128,6,5,5,7,0,
9,68,204,204,204,136,10,14,28,11,0,0,8,128,8,128,
17,0,17,0,127,192,17,0,17,0,34,0,34,0,255,128,
34,0,34,0,68,0,68,0,9,14,28,10,0,0,8,0,
8,0,59,128,123,0,200,0,200,0,232,0,107,0,11,128,
9,128,9,128,111,0,238,0,8,0,8,14,14,9,0,0,
97,179,214,102,12,12,24,24,48,48,102,107,205,134,9,14,
28,10,0,0,56,0,124,0,108,0,108,0,108,0,56,0,
56,128,109,128,199,0,194,0,199,0,237,128,124,128,56,0,
2,5,5,3,0,10,128,192,192,192,64,5,14,14,6,0,
0,24,48,96,96,192,192,192,192,192,192,96,96,48,24,5,
14,14,6,0,0,192,96,48,48,24,24,24,24,24,24,56,
48,96,192,7,7,7,8,0,4,146,214,124,16,124,214,146,
8,10,10,10,0,1,8,24,24,24,127,254,24,24,24,16,
4,6,6,5,0,0,112,96,96,64,192,192,8,2,2,9,
0,5,127,254,3,3,3,4,0,0,224,160,224,8,14,14,
9,0,0,3,3,6,6,12,12,24,24,48,48,96,96,192,
192,9,14,28,10,0,0,62,0,127,0,227,128,197,128,197,
128,197,128,201,128,201,128,209,128,209,128,209,128,227,128,127,
0,62,0,9,14,28,10,0,0,12,0,28,0,60,0,124,
0,8,0,4,0,12,0,12,0,8,0,4,0,12,0,12,
0,127,128,255,128,9,14,28,10,0,0,126,0,255,0,195,
128,193,128,1,128,3,128,63,0,126,0,224,0,192,0,192,
0,192,0,223,128,191,0,9,14,28,10,0,0,126,0,255,
0,195,128,1,128,1,128,3,0,58,0,119,0,3,128,1,
128,1,128,3,128,255,0,126,0,9,14,28,10,0,0,2,
0,6,0,14,0,30,0,62,0,118,0,230,0,198,0,251,
128,247,0,6,0,6,0,6,0,4,0,9,14,28,10,0,
0,127,128,127,128,96,0,96,0,96,0,110,0,111,0,3,
128,1,128,1,128,1,128,195,0,255,0,124,0,9,14,28,
10,0,0,31,0,127,0,96,0,192,0,192,0,192,0,222,
0,223,0,195,128,193,128,193,128,227,0,127,0,60,0,9,
14,28,10,0,0,127,128,255,128,0,0,3,0,3,0,6,
0,6,0,12,0,12,0,24,0,24,0,48,0,48,0,32,
0,9,14,28,10,0,0,58,0,119,0,227,128,193,128,193,
128,99,0,54,0,111,0,227,128,193,128,193,128,227,128,119,
0,46,0,9,14,28,10,0,0,60,0,255,0,231,0,195,
128,193,128,193,128,225,128,253,128,125,128,1,128,3,128,7,
0,127,0,252,0,3,11,11,4,0,2,224,160,224,0,0,
0,0,0,224,160,224,4,13,13,5,0,0,112,80,112,0,
0,0,0,0,112,80,112,96,192,9,11,22,10,0,1,1,
128,3,128,15,0,28,0,120,0,224,0,120,0,28,0,15,
0,3,128,1,128,9,6,12,10,0,4,127,128,255,0,0,
0,0,0,127,128,255,0,9,11,22,10,0,1,192,0,224,
0,120,0,60,0,15,0,3,128,15,0,60,0,120,0,224,
0,192,0,8,14,14,9,0,0,116,238,135,3,3,6,14,
56,48,48,0,0,48,48,9,11,22,10,0,1,62,0,65,
0,128,128,154,128,166,128,162,128,162,128,166,128,155,0,64,
0,63,128,9,14,28,10,0,0,252,0,254,0,199,0,195,
128,193,128,193,128,193,128,253,128,253,128,193,128,193,128,193,
128,193,128,129,0,9,14,28,10,0,0,94,0,223,0,195,
128,193,128,193,128,195,128,255,0,255,0,195,128,193,128,193,
128,195,128,223,0,190,0,9,14,28,10,0,0,14,0,63,
0,115,128,97,128,192,0,192,0,192,0,192,0,192,0,192,
0,96,0,112,0,63,128,15,0,9,14,28,10,0,0,238,
0,111,0,99,128,97,128,97,128,97,128,97,128,97,128,97,
128,97,128,97,128,99,128,111,0,238,0,9,14,28,10,0,
0,95,128,223,0,192,0,192,0,192,0,192,0,223,0,222,
0,192,0,192,0,192,0,192,0,223,128,191,0,9,14,28,
10,0,0,95,128,223,0,192,0,192,0,192,0,192,0,223,
0,222,0,192,0,192,0,192,0,192,0,192,0,128,0,9,
14,28,10,0,0,63,128,127,128,225,128,192,0,192,0,192,
0,192,0,207,128,223,128,193,128,193,128,225,128,127,128,62,
0,9,14,28,10,0,0,129,0,193,128,193,128,193,128,193,
128,193,128,223,128,223,128,193,128,193,128,193,128,193,128,193,
128,64,128,8,14,14,10,1,0,254,127,24,24,24,24,24,
24,24,24,24,24,254,127,9,14,28,10,0,0,31,128,63,
128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,
128,1,128,195,128,255,0,62,0,9,14,28,10,0,0,65,
128,195,128,199,0,206,0,220,0,216,0,216,0,216,0,216,
0,220,0,206,0,199,0,195,128,65,128,9,14,28,10,0,
0,64,0,192,0,192,0,192,0,192,0,192,0,192,0,192,
0,192,0,192,0,192,0,192,0,255,128,255,0,9,14,28,
10,0,0,193,128,227,128,247,128,247,128,213,128,193,128,213,
128,221,128,221,128,201,128,193,128,193,128,193,128,129,0,9,
14,28,10,0,0,225,0,225,128,241,128,241,128,249,128,217,
128,221,128,205,128,205,128,197,128,197,128,193,128,193,128,128,
128,9,14,28,10,0,0,46,0,111,0,227,128,193,128,193,
128,193,128,193,128,193,128,193,128,193,128,193,128,227,128,123,
0,58,0,9,14,28,10,0,0,254,0,255,0,195,128,193,
128,193,128,195,128,223,0,222,0,192,0,192,0,192,0,192,
0,192,0,128,0,10,15,30,10,0,255,46,0,111,0,227,
128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,
128,227,0,123,128,58,192,0,192,9,14,28,10,0,0,126,
0,255,0,195,128,193,128,193,128,195,128,223,0,220,0,206,
0,199,0,195,128,193,128,193,128,129,0,9,14,28,10,0,
0,62,0,127,0,224,0,192,0,192,0,224,0,118,0,27,
0,3,128,1,128,1,128,3,128,255,128,127,0,9,14,28,
10,0,0,255,0,127,128,0,0,12,0,12,0,12,0,12,
0,12,0,12,0,12,0,12,0,12,0,12,0,4,0,9,
14,28,10,0,0,64,128,193,128,193,128,193,128,193,128,193,
128,193,128,193,128,193,128,193,128,193,128,99,0,127,0,62,
0,9,14,28,10,0,0,227,128,99,0,99,0,99,0,34,
0,54,0,54,0,54,0,20,0,28,0,28,0,28,0,8,
0,8,0,10,14,28,11,0,0,64,64,192,192,192,192,192,
192,192,192,192,192,204,192,204,192,204,192,222,192,222,192,211,
192,193,192,128,192,9,14,28,10,0,0,193,128,193,128,193,
128,99,0,99,0,50,0,56,0,28,0,14,0,103,0,99,
0,193,128,193,128,193,128,10,14,28,10,0,0,192,192,192,
192,97,128,97,128,51,0,63,0,30,0,12,0,8,0,4,
0,12,0,12,0,12,0,8,0,9,14,28,10,0,0,127,
128,255,128,1,128,3,128,7,0,6,0,4,0,16,0,48,
0,112,0,224,0,192,0,255,128,255,0,5,14,14,6,0,
0,248,192,192,192,192,192,192,192,192,192,192,192,192,248,9,
14,28,10,0,0,192,0,96,0,96,0,48,0,48,0,24,
0,24,0,12,0,12,0,6,0,6,0,3,0,3,0,1,
128,5,14,14,6,0,0,248,24,24,24,24,24,24,24,24,
24,24,24,24,248,9,6,12,10,0,8,8,0,28,0,54,
0,99,0,193,128,128,128,10,1,2,10,0,255,255,192,4,
3,3,5,0,12,224,96,48,8,11,11,9,0,0,124,127,
3,3,59,123,227,195,199,255,123,9,13,26,10,0,0,64,
0,192,0,192,0,192,0,192,0,222,0,223,0,195,128,193,
128,193,128,195,0,255,0,222,0,8,11,11,9,0,0,30,
63,115,224,192,192,192,224,240,127,30,9,13,26,10,0,0,
0,128,1,128,1,128,1,128,1,128,61,128,125,128,225,128,
193,128,193,128,227,128,127,128,61,128,8,11,11,9,0,0,
60,126,231,195,195,223,222,192,227,127,62,7,13,13,8,0,
0,62,124,96,96,252,248,96,96,96,96,96,96,32,8,13,
13,9,0,0,63,127,227,195,195,195,227,123,51,3,3,127,
254,8,13,13,9,0,0,64,192,192,192,222,223,195,195,195,
195,195,195,130,2,13,13,3,0,0,64,192,128,64,192,192,
192,192,192,192,192,192,128,5,14,14,6,0,255,16,24,24,
8,48,120,24,24,24,24,24,24,120,240,8,13,13,9,0,
0,64,192,192,198,198,204,216,216,216,204,198,199,131,2,14,
14,3,0,0,64,192,192,192,192,192,192,192,192,192,192,192,
192,128,9,11,22,10,0,0,91,0,219,128,201,128,201,128,
201,128,201,128,201,128,201,128,201,128,193,128,129,0,8,11,
11,9,0,0,94,223,195,195,195,195,195,195,195,195,130,8,
11,11,9,0,0,52,118,227,195,195,195,195,195,227,118,52,
8,11,11,9,0,0,252,254,199,195,199,222,220,192,192,192,
128,9,13,26,9,0,255,63,0,127,0,227,0,195,0,195,
0,195,0,251,0,123,0,3,0,3,0,3,128,3,128,3,
128,7,11,11,8,0,0,92,222,224,224,192,192,192,192,192,
192,128,8,11,11,9,0,0,62,127,192,192,240,102,15,3,
3,254,124,6,13,13,7,0,0,32,96,96,252,248,96,96,
96,96,96,96,124,60,8,11,11,9,0,0,65,195,195,195,
195,195,195,195,227,123,58,8,11,11,9,0,0,129,129,195,
195,102,102,102,36,60,24,24,9,11,22,10,0,0,128,128,
193,128,201,128,201,128,201,128,201,128,193,128,221,128,247,128,
227,128,65,0,8,11,11,9,0,0,195,102,102,52,24,24,
24,52,102,102,195,8,12,12,9,0,255,193,227,99,102,110,
44,12,24,24,48,240,224,8,11,11,9,0,0,127,255,7,
6,12,0,48,96,224,255,254,7,14,14,8,0,0,14,28,
24,24,24,48,224,224,48,24,24,24,28,14,2,16,16,5,
1,255,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,8,14,14,9,0,0,224,112,24,24,24,12,7,7,
12,24,24,24,112,224,10,5,10,11,0,4,48,192,120,192,
204,192,199,128,195,0,5,13,13,6,0,1,248,136,136,136,
136,136,136,136,136,136,136,136,248,8,11,11,9,0,0,252,
254,199,195,199,222,220,192,192,192,128,8,11,11,9,0,0,
30,63,115,224,192,192,192,224,240,127,30,8,11,11,9,0,
0,127,254,24,24,24,24,24,24,24,24,16,8,12,12,9,
0,255,193,227,99,102,110,44,12,24,24,48,240,224,8,12,
12,9,0,255,126,255,219,219,219,219,90,24,24,24,24,16,
8,11,11,9,0,0,195,102,102,52,24,24,24,52,102,102,
195,8,12,12,9,0,255,132,198,198,198,198,198,198,198,198,
254,255,3,8,11,11,9,0,0,65,195,195,195,231,127,63,
3,3,3,2,8,11,11,9,0,0,130,195,195,211,219,219,
219,219,219,203,255,8,12,12,9,0,255,130,195,195,211,219,
219,219,219,218,200,255,3,8,11,11,9,0,0,192,224,96,
96,108,110,103,99,103,126,124,8,11,11,9,0,0,130,195,
195,195,219,221,207,199,207,253,251,8,11,11,9,0,0,64,
192,192,192,220,222,199,195,199,254,252,8,11,11,9,0,0,
124,254,198,3,27,59,3,3,6,254,120,9,11,22,10,0,
0,71,0,207,128,205,128,205,128,221,128,221,128,205,128,205,
128,205,128,207,128,135,0,8,11,11,9,0,0,63,127,227,
195,227,123,59,51,51,115,226,9,14,28,10,0,0,252,0,
254,0,199,0,195,128,193,128,193,128,193,128,253,128,253,128,
193,128,193,128,193,128,193,128,129,0,9,14,28,10,0,0,
223,128,223,0,192,0,192,0,192,0,192,0,222,0,223,0,
195,128,193,128,193,128,195,128,255,0,254,0,9,14,28,10,
0,0,94,0,223,0,195,128,193,128,193,128,195,128,255,0,
255,0,195,128,193,128,193,128,195,128,223,0,190,0,9,14,
28,10,0,0,223,0,223,128,192,0,192,0,192,0,192,0,
192,0,192,0,192,0,192,0,192,0,192,0,192,0,128,0,
9,14,28,10,0,0,11,0,27,0,59,0,115,0,99,0,
99,0,99,0,99,0,99,0,99,0,123,0,251,128,193,128,
193,128,9,14,28,10,0,0,95,128,223,0,192,0,192,0,
192,0,192,0,223,0,222,0,192,0,192,0,192,0,192,0,
223,128,191,0,10,14,28,11,0,0,64,64,192,192,196,192,
204,192,204,192,109,128,109,128,109,128,109,128,204,192,204,192,
204,192,200,192,128,128,9,14,28,10,0,0,122,0,251,0,
131,128,1,128,1,128,3,0,58,0,123,0,3,128,1,128,
1,128,131,128,251,0,120,0,9,14,28,10,0,0,67,128,
195,128,199,128,199,128,199,128,205,128,205,128,205,128,217,128,
217,128,217,128,209,128,209,128,193,0,9,14,28,10,0,0,
91,128,219,128,215,128,199,128,199,128,205,128,205,128,205,128,
217,128,217,128,217,128,209,128,209,128,193,0,9,14,28,10,
0,0,65,128,195,128,199,0,206,0,220,0,216,0,216,0,
216,0,216,0,220,0,206,0,199,0,195,128,65,128,9,14,
28,10,0,0,220,0,222,0,199,0,195,128,193,128,193,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
9,14,28,10,0,0,193,128,227,128,247,128,247,128,213,128,
193,128,213,128,221,128,221,128,201,128,193,128,193,128,193,128,
129,0,9,14,28,10,0,0,129,0,193,128,193,128,193,128,
193,128,193,128,223,128,223,128,193,128,193,128,193,128,193,128,
193,128,64,128,9,14,28,10,0,0,46,0,111,0,227,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
227,128,123,0,58,0,9,14,28,10,0,0,223,128,223,128,
193,128,193,128,193,128,193,128,193,128,193,128,193,128,193,128,
193,128,193,128,193,128,129,0,9,14,28,10,0,0,254,0,
255,0,195,128,193,128,193,128,195,128,223,0,222,0,192,0,
192,0,192,0,192,0,192,0,128,0,9,14,28,10,0,0,
14,0,63,0,115,128,97,128,192,0,192,0,192,0,192,0,
192,0,192,0,96,0,112,0,63,128,15,0,9,14,28,10,
0,0,255,0,127,128,0,0,12,0,12,0,12,0,12,0,
12,0,12,0,12,0,12,0,12,0,12,0,4,0,9,14,
28,10,0,0,129,0,193,128,193,128,193,128,193,128,125,128,
61,128,1,128,1,128,1,128,193,128,225,128,127,0,62,0,
10,14,28,11,0,0,63,0,127,128,237,192,204,192,204,192,
237,192,109,128,45,0,12,0,12,0,12,0,12,0,12,0,
4,0,9,14,28,10,0,0,193,128,193,128,193,128,99,0,
99,0,50,0,56,0,28,0,14,0,103,0,99,0,193,128,
193,128,193,128,10,15,30,10,0,255,130,0,195,0,195,0,
195,0,195,0,195,0,195,0,195,0,195,0,195,0,195,0,
195,0,223,0,223,128,1,192,9,14,28,10,0,0,129,0,
193,128,193,128,193,128,193,128,193,128,225,128,125,128,61,128,
1,128,1,128,1,128,1,128,0,128,10,14,28,11,0,0,
128,128,192,192,192,192,192,192,200,192,204,192,204,192,204,192,
204,192,204,192,196,192,192,64,223,128,95,192,11,15,30,11,
0,255,128,128,192,192,192,192,192,192,200,192,204,192,204,192,
204,192,204,192,204,192,196,192,192,64,223,128,95,192,0,224,
9,14,28,10,0,0,224,0,224,0,96,0,96,0,96,0,
96,0,110,0,111,0,99,128,97,128,97,128,99,128,127,0,
62,0,10,14,28,11,0,0,128,128,192,192,192,192,192,192,
192,192,192,192,220,192,222,192,199,64,195,64,195,64,199,64,
254,192,124,192,9,14,28,10,0,0,128,0,192,0,192,0,
192,0,192,0,192,0,222,0,223,0,195,128,193,128,193,128,
195,128,255,0,254,0,9,14,28,10,0,0,62,0,127,0,
227,128,193,128,193,128,1,128,29,128,29,128,1,128,1,128,
193,128,227,128,127,0,62,0,10,14,28,11,0,0,71,0,
207,128,221,192,216,192,216,192,216,192,248,192,248,192,216,192,
216,192,216,192,221,192,207,128,135,0,9,14,28,10,0,0,
63,128,127,128,225,128,193,128,193,128,225,128,125,128,61,128,
29,128,57,128,113,128,225,128,193,128,129,0,8,11,11,9,
0,0,124,127,3,3,59,123,227,195,199,255,123,8,11,11,
9,0,0,7,31,56,112,102,207,195,195,231,126,60,8,11,
11,9,0,0,92,222,198,198,220,222,195,195,199,222,188,8,
11,11,9,0,0,254,255,192,192,192,192,192,192,192,192,128,
10,11,22,11,0,0,31,128,31,128,25,128,49,128,49,128,
49,128,1,128,127,192,255,192,192,192,192,192,8,11,11,9,
0,0,60,126,231,195,195,223,222,192,227,127,62,9,11,22,
10,0,0,64,128,201,128,201,128,107,0,54,0,54,0,107,
0,201,128,201,128,201,128,129,0,8,11,11,9,0,0,116,
246,195,7,126,62,6,3,7,254,124,8,11,11,9,0,0,
65,195,195,199,207,223,219,211,195,195,130,8,11,11,9,0,
0,89,219,211,199,207,223,219,211,195,195,130,8,11,11,9,
0,0,71,207,204,220,216,216,216,220,206,199,67,8,11,11,
9,0,0,27,59,115,227,195,195,195,195,195,195,195,9,11,
22,10,0,0,65,0,227,128,247,128,247,128,213,128,213,128,
213,128,213,128,193,128,193,128,129,0,8,11,11,9,0,0,
65,195,195,251,251,195,195,195,195,195,130,8,11,11,9,0,
0,52,118,227,195,195,195,195,195,227,118,52,8,11,11,9,
0,0,95,223,195,195,195,195,195,195,195,195,130,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255};
подключаю Arduino nano нажимаю загузить — стрелочку и выдет
Arduino: 1.8.1 (Windows 7), Плата:»Arduino Nano, ATmega328″
C:Program Files (x86)ArduinolibrariesDDS_sweeper1_TFT_ST7735_128x160_v4_hwspiDDS_sweeper1_TFT_ST7735_128x160_v4_hwspi.ino:18:20: fatal error: Ucglib.h: No such file or directory
#include «Ucglib.h»
^
compilation terminated.
exit status 1
Ошибка компиляции для платы Arduino Nano.
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariesad9850adafuilt: C:Program Files (x86)Arduinolibrariesad9850adafuilt
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesDDS_sweeper1_TFT_ST7735_128x160: C:Program Files (x86)ArduinolibrariesDDS_sweeper1_TFT_ST7735_128x160
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesLCD_ID_Reader: C:Program Files (x86)ArduinolibrariesLCD_ID_Reader
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesOLED_RUS: C:Program Files (x86)ArduinolibrariesOLED_RUS
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariessimple_dds_st7735_2: C:Program Files (x86)Arduinolibrariessimple_dds_st7735_2
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT-Shield-Example-Code-master: C:Program Files (x86)ArduinolibrariesTFT-Shield-Example-Code-master
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT_Touch_Shield: C:Program Files (x86)ArduinolibrariesTFT_Touch_Shield
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT_Ucglib: C:Program Files (x86)ArduinolibrariesTFT_Ucglib
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTSCalibration: C:Program Files (x86)ArduinolibrariesTSCalibration
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariesucglib-master: C:Program Files (x86)Arduinolibrariesucglib-master
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariesutf8rus3: C:Program Files (x86)Arduinolibrariesutf8rus3
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesUTFT: C:Program Files (x86)ArduinolibrariesUTFT
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariesad9850adafuilt: C:Program Files (x86)Arduinolibrariesad9850adafuilt
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesDDS_sweeper1_TFT_ST7735_128x160: C:Program Files (x86)ArduinolibrariesDDS_sweeper1_TFT_ST7735_128x160
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesLCD_ID_Reader: C:Program Files (x86)ArduinolibrariesLCD_ID_Reader
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesOLED_RUS: C:Program Files (x86)ArduinolibrariesOLED_RUS
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariessimple_dds_st7735_2: C:Program Files (x86)Arduinolibrariessimple_dds_st7735_2
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT-Shield-Example-Code-master: C:Program Files (x86)ArduinolibrariesTFT-Shield-Example-Code-master
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT_Touch_Shield: C:Program Files (x86)ArduinolibrariesTFT_Touch_Shield
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTFT_Ucglib: C:Program Files (x86)ArduinolibrariesTFT_Ucglib
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesTSCalibration: C:Program Files (x86)ArduinolibrariesTSCalibration
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariesucglib-master: C:Program Files (x86)Arduinolibrariesucglib-master
Неверная библиотека найдена в C:Program Files (x86)Arduinolibrariesutf8rus3: C:Program Files (x86)Arduinolibrariesutf8rus3
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesUTFT: C:Program Files (x86)ArduinolibrariesUTFT
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
«Показать подробный вывод во время компиляции»
- Войдите на сайт для отправки комментариев
Пнд, 29/05/2017 — 12:30
#50
T.Rook
Offline
Зарегистрирован: 05.03.2016
DAFdriver, да поправьте уже #include «Ucglib.h» на #include <Ucglib.h> !!!!! Вам же уже несколько раз советовали. Или обеспечьте наличие Ucglib.h Ucglib.cpp в папке Вашего скетча.
И наконец-то научитесь правильно вставлять код в сообщение на форуме. Прочтите «Вставка программного кода в комментарий» (одна из приклееных тем вверху)
- Войдите на сайт для отправки комментариев
- 1
- 2
- 3
- следующая ›
- последняя »
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Comments
As soo ad I uncomment «//#define LCD_I2C_SAINSMART_YWROBOT» to try to use a LCM1602 ywrobot LCD screen with marlin i obtain this error:
fatal error: LCD.h: No such file or directory
#include <LCD.h>
^
compilation terminated.
MacOs latest Marlin version and Arduino IDE also
Someone can help. Thanks a lot!
I’ve been able to reproduce the problem in a Widows environment.
I’ll need to do some research before I can propose a solution.
Looks like you need a new «liquidcrystal» library. I was able to get it to compile once I had the correct one for this card installed.
Go to https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home and install that library in Arduino.
I had a devil of a time getting it to work because I needed to clear out all the other «liquidcrystal» libraries from the Arduino search path. My suggestion is:
- search your computer for all files that start with liquidcrystal.
- move the directories that contain those files to a temporary location. This temp location can NOT be a subdirectory of any of the original paths.
- Download & install the new library per the instructions in the above link.
- Compile Marlin
- if all is well then delete the temp location.
Thank you a lot! i will try as soon as i can but i’m confident it will work.
can you please send lcd.h library files
above link is not working
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Содержание
- Arduino.ru
- Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
- forum.arduino.ru
- #Avrdude
- Upload not working #164
- Comments
- Footer
- Arduino.ru
- Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
- forum.arduino.ru
- exit status 1 Ошибка компиляции для платы Arduino Nano.Задолбало
- Upload fails in subsequent windows with Serial Monitor open #726
- Comments
- Describe the bug
- To Reproduce
- Expected behavior
- Desktop
- Additional context
- Arduino.ru
- Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
- forum.arduino.ru
- exit status 1 Ошибка компиляции для платы Arduino Nano.Задолбало
Arduino.ru
Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
forum.arduino.ru
#Avrdude
boolean butt_flag = 0 ;
Драйвера скорее всего не установлены
у меня работал раньше только с платой Uno
в один момент перестал работать
тут нет никаких ошибок, просто винда не видит плату.
проблема или с драйверамиили с кабелями или с самой ардуиной
Этим все сказано.
Плата новая, кабель data, Windows обнаруживает как USB-Serial CH340 (com*)
только что переустановил драйвера, IDE
Как перебороть эту ошибку
у меня работал раньше только с платой Uno
поясните эту фразу.
Раньше работало с уно, а теперь взял ХХХХ — не работает? Что взяли вместо уно? Определяется ли нынешняя плата ХХХХ виндой? заливались на нее прежде скетчи?
Значит не тот порт выбран. Чудес не бывает
я устранил проблему. Всем Спасибо!))
в отделе инструменты/процессор/Atmega328P(old bootloader)
я устранил проблему. Всем Спасибо!))
в отделе инструменты/процессор/Atmega328P(old bootloader)
вы слепой? — см ответ #3
он пошел по форуму всех теперь учить, что надо делать, не глядя на даты.
Нуууу ребяты. Словить ошибку 500 это недостойно для настоящего ардуинщика. Набираем в поиске «stk500_recv()» читаем и смотрим видосы до полного понимания проблемы.
Пока писал, уже все сделали, молодцы.
Гдей-то тут ашипка 500?
я устранил проблему. Всем Спасибо!))
в отделе инструменты/процессор/Atmega328P(old bootloader)
Вам это сказали с самого начала — #3. Ответов не читаем?
Кстати, если бы Вы смилостивились сказать, что у Вас проблема именно с Нано, ответ был бы не в третьем, а в первом посте. Учитесь вопросы задавать.
Источник
Upload not working #164
I am trying to upload the test sketch from the readme to an arduino leonardo. I have compiled it sucessfully, but when I try to upload I get the following: Connecting to programmer: Found programmer: ; type = S Software Version = 1.0; No Hardware Version given. Programmer supports buffered memory access with buffersize=128 bytes. Programmer supports the following devices: Device code: 0x44 I am running the latest version which I have just compiled today. The program previously uploaded is no longer running.
The text was updated successfully, but these errors were encountered:
Is that the full output from the upload command?
Any update/workaround about how to upload a sketch to an Arduino Leonardo using Arduino CLI? I still get the same error using the latest nightly build.
I get this message with the Arduino Micro
We are getting this same issue although that’s not the full message in our case:
We have successfully uploaded via the Arduino IDE on this same device with same cable/etc setup.
We’ve also been having this issue for a long time but are only able now to address it.
Any updates or anything I can try? We are trying to get this working for a network of remote devices and can’t rely on the IDE upload.
May you run the same command adding: —log-level debug -v and copy the output here?
In case you are on MacOSX Catalina you must install all the system updates available.
I was trying to change the baudrate with the .avrduderc (which I think I am doing wrong), so it just contains:
Try to upload full output @mo-pyy
I have the same issue .
Please find below my detailed logs
Version: 2.0.0
Date: 2022-09-14T07:06:37.759Z
CLI Version: 0.27.1 [a900cfb]
Copyright © 2022 Arduino SA
Hi @mo-pyy and @wtgee. You have posted the output from a successful upload so all is well. Congratulations!
If you have any other questions, you are welcome to post on the Arduino forum. We’ll be happy to help you out over there:
get this message with the Arduino Micro
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Arduino.ru
Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
forum.arduino.ru
exit status 1 Ошибка компиляции для платы Arduino Nano.Задолбало
После долгих мучений все заработало . Пришлось несколько раз ардуино иде искать и скачивать , проблемма в ней оказалась .
ну если не в состоянии прочитать текст сообщения #67 — то только и остается по кругу ИДЕ переставлять. Сказано же четко — автор проекта неправильно описал библиотеку. ее нужно не устанавливать средствами Ардуино ИДЕ, а вручную положить в папку со скетчем. Неужели это так трудно понять?
Хотя некоторые и при отстуствии драйверов на флешку первым делом бегут всю винду переставлять.
Какраз в иде проблемма была . весь форум перелопатил , что только не делал и по подсказкам форума и по своему , все равно ни чег не шло . Переставил стал другую ошибку выдавать , пока не нашел нормальную иде . Вссе сделал , как и до переустановки и сразу все пошло и скетч и русский язык и все ,что мне нужно с ним делать.Теперь думаю , как эту ид на флешку или диск сбросить вместе с библиотеками , чтоб потом не искать .
Может мне кто поможет. Правда у меня Arduino UNO
Есть скетч для Nano, пытаюсь залить в UNO — выдает ошибку при заливке. Я начинающий и только на первых шагах.
Библиотеки лежат в папке со скетчем
«fatal error: LiquidCrystal_I2C.h: No such file or directory» — первод требуется?
Да разобрался поставил другие библиотеки и пошло.
И у меня такая же проблема. Заливаю скетч и он выдаёт ошибку, говоря что ожидается деконструктор, конструктор или ещё что-то, указывая на строку в коде: digitalWrite(CS, HIGH);
Подключал светодиодную плату. (Просто написал, а то мало ли) в начале кода объявил константу, так что не подумайте.
И у меня такая же проблема. Заливаю скетч и он выдаёт ошибку, говоря что ожидается деконструктор, конструктор или ещё что-то, указывая на строку в коде: digitalWrite(CS, HIGH);
какая же это нафик «такая же проблема», если ошибка совсем другая? Или вы не вникаете и для вас любая ошибка при компиляции — «такая же»?
По делу — приведите текст скетча и скопируйте сюда лог компиляции с ошибками. Только не надо вставлять скриншоты Ардуино ИДЕ или видео компиляции — это никому не интересно.
извините, если сильно многонаписал
И у меня такая же проблема. Заливаю скетч и он выдаёт ошибку, говоря что ожидается деконструктор, конструктор или ещё что-то, указывая на строку в коде: digitalWrite(CS, HIGH);
какая же это нафик «такая же проблема», если ошибка совсем другая? Или вы не вникаете и для вас любая ошибка при компиляции — «такая же»?
По делу — приведите текст скетча и скопируйте сюда лог компиляции с ошибками. Только не надо вставлять скриншоты Ардуино ИДЕ или видео компиляции — это никому не интересно.
на счёт того ,что я писал «такая же проблема», я имел ввиду, что у менятоже в ошибке написано «exit status1». не удивляйтесь, я новичок.
Источник
Upload fails in subsequent windows with Serial Monitor open #726
Describe the bug
The Arduino IDE uses the serial ports of Arduino boards in two different ways:
- Uploading sketches
- Communication via Serial Monitor
The port can not be used for both of these things simultaneously. The IDE handles the condition of Serial Monitor being open when an upload is started automagically like so:
- Close port in Serial Monitor
- Complete upload process
- Reopen port in Serial Monitor
🐛 This works as expected in the first IDE window you open, but it no longer works in subsequent windows.
NOTE: although similar, this is different from #586 because it occurs even when the port is not open in a Serial Monitor/Serial Plotter of another IDE window.
To Reproduce
- Connect an Arduino board to your computer.
- Select the appropriate board and port.
- Select Tools > Serial Monitor from the Arduino IDE menus to open Serial Monitor.
- Select Sketch > Upload from the Arduino IDE menus.
🙂 Upload succeeds as expected. - Select Tools > Serial Monitor from the Arduino IDE menus to close Serial Monitor.
This is necessary to avoid
Upload fails if port is open in Serial Monitor of another window #586
🐛 Note that there is an unexpected banner in Serial Monitor:
Not connected. Select a board and a port to connect automatically.
Expected behavior
Upload with Serial Monitor open in the same IDE window to always be handled automagically.
Desktop
- OS: Windows 10
- Version: 2.0.0-rc3
Date: 2021-12-22T15:46:56.004Z
CLI Version: 0.20.2 [13783819]
Additional context
It is not necessary to leave the original window open to reproduce the bug. It occurs even if that window is closed.
I bisected the issue to 767b09d (it does not occur at 8839793).
The text was updated successfully, but these errors were encountered:
Closing as fixed by #982
why is this closed? this is still an issue in rc9.2.
If you don’t manually close the «Serial Monitor» tab at the bottom before trying to upload a sketch, it just gives you the:
Failed uploading: uploading error: exit status 1avrdude: ser_open(): can’t open device «\.COM#»: Access Denied
error
Hi @ProxyPlayerHD. Thanks for your report.
The issue is closed because the bug was fixed for me and the majority of the other users who reported being affected by it after the changes made in #982.
We are tracking one other report of continued failing uploads at #1306, but it is not certain that it has the same cause and we have not even been able to determine how the developers can reproduce that issue.
Please provide more information:
- Which Arduino board are you using?
- Does the problem occur consistently, or intermittently?
- Does the problem persist after you restart your computer?
- Does the problem also occur when using Arduino IDE 2.0.0-rc9 or older (download links for 2.0.0-rc9 listed here, or 1.8.19 here)
hmm, i hate it when it does this. aparently the issues seems to have fixed itself out of nowhere. but now a different issue emerged where the Serial Monitor doesn’t display anything from my Arduino Mega 2560 but works fine for other board i tested it with (Nucleo 144, and RaspPi Pico).
i just have a looping «Hello World!» program on the Arduino and i can see the sending LED constantly being lit up but nothing appears in the IDE. I can send stuff from the Serial Monitor to the Arduino and see the receiving LED light up shortly when i do it, so clearly it has a working connection.
power cycling/reconnecting the Arduino or restarting the IDE doesn’t fix it. (reuploading the sketch while the Serial Monitor is open makes it print a few garbled «Hello World»‘s)
i can also use some other terminal software like Teraterm to connect to the Arduino and it works perfectly fine there.
this is probably enough to open a seperate issue, but i’ll restart my PC to see if that maybe fixes it
EDIT: nope that didn’t fix it. swaping board again it’s really oly the Mega that doesn’t want to display stuff in the Serial Monitor.
Источник
Arduino.ru
Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
forum.arduino.ru
exit status 1 Ошибка компиляции для платы Arduino Nano.Задолбало
После долгих мучений все заработало . Пришлось несколько раз ардуино иде искать и скачивать , проблемма в ней оказалась .
ну если не в состоянии прочитать текст сообщения #67 — то только и остается по кругу ИДЕ переставлять. Сказано же четко — автор проекта неправильно описал библиотеку. ее нужно не устанавливать средствами Ардуино ИДЕ, а вручную положить в папку со скетчем. Неужели это так трудно понять?
Хотя некоторые и при отстуствии драйверов на флешку первым делом бегут всю винду переставлять.
Какраз в иде проблемма была . весь форум перелопатил , что только не делал и по подсказкам форума и по своему , все равно ни чег не шло . Переставил стал другую ошибку выдавать , пока не нашел нормальную иде . Вссе сделал , как и до переустановки и сразу все пошло и скетч и русский язык и все ,что мне нужно с ним делать.Теперь думаю , как эту ид на флешку или диск сбросить вместе с библиотеками , чтоб потом не искать .
Может мне кто поможет. Правда у меня Arduino UNO
Есть скетч для Nano, пытаюсь залить в UNO — выдает ошибку при заливке. Я начинающий и только на первых шагах.
Библиотеки лежат в папке со скетчем
«fatal error: LiquidCrystal_I2C.h: No such file or directory» — первод требуется?
Да разобрался поставил другие библиотеки и пошло.
И у меня такая же проблема. Заливаю скетч и он выдаёт ошибку, говоря что ожидается деконструктор, конструктор или ещё что-то, указывая на строку в коде: digitalWrite(CS, HIGH);
Подключал светодиодную плату. (Просто написал, а то мало ли) в начале кода объявил константу, так что не подумайте.
И у меня такая же проблема. Заливаю скетч и он выдаёт ошибку, говоря что ожидается деконструктор, конструктор или ещё что-то, указывая на строку в коде: digitalWrite(CS, HIGH);
какая же это нафик «такая же проблема», если ошибка совсем другая? Или вы не вникаете и для вас любая ошибка при компиляции — «такая же»?
По делу — приведите текст скетча и скопируйте сюда лог компиляции с ошибками. Только не надо вставлять скриншоты Ардуино ИДЕ или видео компиляции — это никому не интересно.
извините, если сильно многонаписал
И у меня такая же проблема. Заливаю скетч и он выдаёт ошибку, говоря что ожидается деконструктор, конструктор или ещё что-то, указывая на строку в коде: digitalWrite(CS, HIGH);
какая же это нафик «такая же проблема», если ошибка совсем другая? Или вы не вникаете и для вас любая ошибка при компиляции — «такая же»?
По делу — приведите текст скетча и скопируйте сюда лог компиляции с ошибками. Только не надо вставлять скриншоты Ардуино ИДЕ или видео компиляции — это никому не интересно.
на счёт того ,что я писал «такая же проблема», я имел ввиду, что у менятоже в ошибке написано «exit status1». не удивляйтесь, я новичок.
Источник












