C/C++ With Espruino

Posted on
  • Instead of using Java, can I use a native C/C++ programming language?
    I understand I might not be able to use Web ID, but that is OK.... is using C/C++ possible?

  • Hello and hapy new year,
    Simply said: espruino is a javascript interpreter and a set of boards. Java is in no way able to run on the boards that run espruino.
    As the interpreter is written in C/C++, you should certainly be able to use C or C++ on the board that is running it so far.
    You could also see this thread if you need to add some C/C++ functionalities to the interpreter.
    See your board manufacturer for further details about dev environnement.

  • That said, writing javascript instead of C/C++, and all the things that come with doing that is the whole point of Espruino. If you want to write C/C++ instead of javascript, why are you using Espruino? There's nothing special about the hardware - it can be programmed with whatever you'd normally use for programming the mcu (what this is depends on which board, and I don't know it off the top of my head) - but this is a sort of silly thing to do, since you pay a large premium on the boards to get official and responsive support for the Espruino interpreter.

  • Thanks for the reply.

    The thing that looks attractive about Espruine is that it has new hardware modules that I can not find in similar module? is this correct or am I missing something here?

    For examples all there hardware modules and the recent Seeed Wio LTE?

    https://www.espruino.com/Modules

  • and in addition, according to Espruino, many of the modules are low-power consumption compared to others. This makes it more attractive for wireless modules and applications, or battery-powered applications

  • The modules at https://www.espruino.com/Modules are actually code that is written in JavaScript, to allow you to use pre-existing bits of hardware with low power consumption.

    Espruino doesn't draw much power specifically because of its use of JavaScript. You could write in C/C++, but then you wouldn't be able to lose those modules so you wouldn't be better off than if you had used some other board.

    Another option is to use Espruino, but to then write extensions for it in C/C++ - but it sounds like that might not be what you want.

  • Thanks Gordon .

    The below are hardware modules and not a software module? right? my point is that, irrespective of using Java or C/C++, these hardware module are good collections to use in many applications and some of these hardware can have low-power consumption.

    https://www.espruino.com/Modules

    Existing Modules
    •433.92Mhz Transmitter and Receiver
    •ADNS5050 Optical Mouse Sensor
    •ADS1x15 programmable gain ADC
    •ADS7843 Touchscreen
    •ADXL335 Accelerometer
    •ADXL345 Accelerometer
    •AT Command Handler
    •Analog RGB LED Control
    •Arduino Pico adaptor board
    •BH1750 I2C Light Sensor
    •BMP Loader Module
    •BMP085/BMP180 digital pressure sensor
    •CAP1188 capacitive touch breakout
    •CC3000 WiFi Module
    •CMUcam5 Pixy
    •Charlieplexed LED Module
    •Clock Module
    •DCF77
    •DHT11 Temperature and RH Sensor
    •DHT22/AM230x/RHT0x Temperature and RH Sensor
    •DMX
    •DS18B20 Temperature Sensor
    •DS3231 RTC
    •Date Module

  • Those Modules are software to drive/use the respective hardware modules.

    For Example:
    If i have a project in mind, let say a weatherstation, and i want to use a DHT11 to measure
    the temperature. I connect the DHT11 sensor (hardware module) to my espruino. Then i need some software to "talk" to the sensor so i can read the temperature. This is where the espruino modules come into play. I require the library (software module) for the DHT11 and can easily connect and read temperature data from the sensor.

  • Paddek:
    Clicking on any of these modules, they are hardware module.

    For example:
    https://www.espruino.com/433Mhz

  • Yes most of the modules have extensive documentation how to connect the hardware and example code. I edited my previous post with an example to further show the differences but you were to fast answering :D

  • right...Thanks

  • Hi. The Espruino extension in C/C++is required. How to get the system time that get gettime (), but in C++?

  • jshGetSystemTime?

  • probably,
    and here is so can be: jsiConsolePrint(jshGetSystemTime()); ?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

C/C++ With Espruino

Posted by Avatar for user84673 @user84673

Actions