Any support (libraries or code) for SX1278 Lora programming? Simple code please, as to make it transmit or receive mode in full power and how to reflect a pin ON or OFF from transmitter to receiver
However, I imagine that getting one of these operational would be similar to setting up most other RF transceivers. Set the registers up for whatever mode and frequencies you want t o use. Then write some interrupt driven code like a "State Machine" to manage TX and RX operations as well as error handling.
Arduino may have some libs for this that could be converted to GCB, or at least to provide some direction for writing the code.
Bill
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I posted about a basic to c converter.
no c to basic converter found.
since arduino is so popular for devices then, as Anobium posted, simple conversion c to gcb.
A guide to convert arduino c to gcb would be handy so a diy solution rather than asking the forum.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It takes an English Like syntax and converts it into the Assembler (Machine Language) for the target device.
C on the other hand is a low level language or, as one Computer Scientist friend of mine puts it, C is a High-level Assembler.
C++ the language used by Arduino is an Object oriented Language - Whilst it has the C syntax it is not C. It is a Fifth Generation High Level language and has about as much in common with BASIC as Mandarin has to German.
The syntax can be emulated but the underlying architecture is vastly different and requires von Neumann architecture whilst the PIC Devices use Harvard architecture.
The Harvard architecture is a computer architecture with separate storage and signal pathways for instructions and data. It contrasts with the von Neumann architecture, where program instructions and data share the same memory and pathways.
So sorry, No, GCBASIC can not Convert C + + nor can the PIC architecture support it.
What Bill is alluding too is that any code written for any platform can be treated as an Algorithm.
That is you can read the code to gain an understanding of how the problem was resolved on the first platform and then use the same principals and mathematics to write a new solution on your target platform.
That requires analytical skills and computer literacy so is not the sort of thing that can be automated without extremely powerful AI.
Cheers
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know very little about C so I will bow to @caroper (Chris Roper)'s knowledge of the differences between the language levels of GCBasic and C.
I know only a fraction more about BASIC, but I'm quite persistent. My programs eventually work. Mostly by a process of elimination than good coding. I try all the things that don't work first, before whittling it down to something that shows potential, then honing that into something that approximates the result I aimed for in the first instance. Not efficient in any way, but generally I get there...
Is it beyond the land of myths, legends and fairies to imagine a situation where an Arduino library (written in C++) is assembled into a .hex (or .asm) file using the Arduino compiler, then that file used as an "include" from GCB? {This assumes the GCB target is an Atmel or AVR processor}
GCB can compile for AVR processors so I had assumed (possibly incorrectly) that there were enough similarities between the devices to enable this to happen.
If there was access to the assembly code for the compiled Arduino library, could it not be "read" to determine the entry points and labels for calling it as you might from an Arduino program?
It is (or at least was) possible to decompile a PIC .hex file into assembly. Assembly code can be used in a GCB program which is the thought process which led me to this crazy theory.
I apologise in advance if this is the craziest idea I've ever come up with, and believe me, I've come up with some that are truly out there.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I was to learn c++ , I would "think" in basic and how to do it in c++.
I guess I should learn c++ and then maybe gcb equivalent code.
It's just that there seems to be an arduino solution for most gadget hardware
when I search but hardly ever basic.
Python is supposed to be easy like basic. I don't think so or maybe rpi solutions for hardware.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I said above that C is almost an assembler, it is a low level language.
GCBASIC generates ASM output but it could just as soon generate C output.
It generates ASM because Microchip have only recently started to support C on 8 bit PIC devices and even then it is limited because of the Harvard Architecture.
C++ is a high level language with Classes, inheritance and other Object Oriented Principals very far removed from BASIC or C.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Chris-
"C++ is a high level language with Classes, inheritance and other Object Oriented Principals very far removed from BASIC or C."
ok but lots of example arduino code looks just like in line code but in c++
If you can understand the way it's written, the logical flow then converting
to basic may be easy.
in the meantime it's Chinese data sheets with c ,c++ as examples...like microchip.
they might just as well be Chinese sometimes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you see a device and think handy but how to implement it a search will rarely
show basic
won't show lots for pics often.
but any dumbo can use arduino cut and paste etc to get it working.
using it is another subject, often set up for a user so no knowledge needed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Any support (libraries or code) for SX1278 Lora programming? Simple code please, as to make it transmit or receive mode in full power and how to reflect a pin ON or OFF from transmitter to receiver
Last edit: sfyris 2021-01-17
No library in record.
However, Bill Roth may have something. He has mentioned Lora a few times in discussions.
Sorry, I have nothing for SX1278 LoRa.
However, I imagine that getting one of these operational would be similar to setting up most other RF transceivers. Set the registers up for whatever mode and frequencies you want t o use. Then write some interrupt driven code like a "State Machine" to manage TX and RX operations as well as error handling.
Arduino may have some libs for this that could be converted to GCB, or at least to provide some direction for writing the code.
Bill
I posted about a basic to c converter.
no c to basic converter found.
since arduino is so popular for devices then, as Anobium posted, simple conversion c to gcb.
A guide to convert arduino c to gcb would be handy so a diy solution rather than asking the forum.
LOL.
A converter... lol.
Maybe we could extend it read Mandarin too.
@Stan,
GCBASIC is a so-called High level language.
It takes an English Like syntax and converts it into the Assembler (Machine Language) for the target device.
C on the other hand is a low level language or, as one Computer Scientist friend of mine puts it, C is a High-level Assembler.
C++ the language used by Arduino is an Object oriented Language - Whilst it has the C syntax it is not C. It is a Fifth Generation High Level language and has about as much in common with BASIC as Mandarin has to German.
The syntax can be emulated but the underlying architecture is vastly different and requires von Neumann architecture whilst the PIC Devices use Harvard architecture.
The Harvard architecture is a computer architecture with separate storage and signal pathways for instructions and data. It contrasts with the von Neumann architecture, where program instructions and data share the same memory and pathways.
So sorry, No, GCBASIC can not Convert C + + nor can the PIC architecture support it.
What Bill is alluding too is that any code written for any platform can be treated as an Algorithm.
That is you can read the code to gain an understanding of how the problem was resolved on the first platform and then use the same principals and mathematics to write a new solution on your target platform.
That requires analytical skills and computer literacy so is not the sort of thing that can be automated without extremely powerful AI.
Cheers
Chris
I am I to understand that none of you guys have a copy the Arduino C to GCB Converter software yet?
Sheesh !
I know very little about C so I will bow to @caroper (Chris Roper)'s knowledge of the differences between the language levels of GCBasic and C.
I know only a fraction more about BASIC, but I'm quite persistent. My programs eventually work. Mostly by a process of elimination than good coding. I try all the things that don't work first, before whittling it down to something that shows potential, then honing that into something that approximates the result I aimed for in the first instance. Not efficient in any way, but generally I get there...
Is it beyond the land of myths, legends and fairies to imagine a situation where an Arduino library (written in C++) is assembled into a .hex (or .asm) file using the Arduino compiler, then that file used as an "include" from GCB? {This assumes the GCB target is an Atmel or AVR processor}
GCB can compile for AVR processors so I had assumed (possibly incorrectly) that there were enough similarities between the devices to enable this to happen.
If there was access to the assembly code for the compiled Arduino library, could it not be "read" to determine the entry points and labels for calling it as you might from an Arduino program?
It is (or at least was) possible to decompile a PIC .hex file into assembly. Assembly code can be used in a GCB program which is the thought process which led me to this crazy theory.
I apologise in advance if this is the craziest idea I've ever come up with, and believe me, I've come up with some that are truly out there.
basic to c
https://www.basic-converter.org
http://bcx-basic.sourceforge.net
https://sourceforge.net/projects/qbasictoc/
If I was to learn c++ , I would "think" in basic and how to do it in c++.
I guess I should learn c++ and then maybe gcb equivalent code.
It's just that there seems to be an arduino solution for most gadget hardware
when I search but hardly ever basic.
Python is supposed to be easy like basic. I don't think so or maybe rpi solutions for hardware.
I think you missed the point Stan.
C++ is not C.
I said above that C is almost an assembler, it is a low level language.
GCBASIC generates ASM output but it could just as soon generate C output.
It generates ASM because Microchip have only recently started to support C on 8 bit PIC devices and even then it is limited because of the Harvard Architecture.
C++ is a high level language with Classes, inheritance and other Object Oriented Principals very far removed from BASIC or C.
Chris-
"C++ is a high level language with Classes, inheritance and other Object Oriented Principals very far removed from BASIC or C."
ok but lots of example arduino code looks just like in line code but in c++
If you can understand the way it's written, the logical flow then converting
to basic may be easy.
in the meantime it's Chinese data sheets with c ,c++ as examples...like microchip.
they might just as well be Chinese sometimes.
Yes, That is the point.
If you can unravel the C++ code and its dependencies then you can recreate it in any other language.
But a converter to automate the process is not currently feasible without AI.
If you see a device and think handy but how to implement it a search will rarely
show basic
won't show lots for pics often.
but any dumbo can use arduino cut and paste etc to get it working.
using it is another subject, often set up for a user so no knowledge needed.