Forum > Suggestions
Why no Freepascal for Arduino?
coradi:
Libs and defination files convert from arduino to freepascal, so you can youese freepascal for easy programming, like arduiono.
At this moment there are no def files like arduino and no liba for any Temp Sensor, TFT, LCD and so on
At this time it is hard to program with freepascal, because you have to do all bare metal
Thaddy:
What is hard? Translate a datasheet?
coradi:
Yes, for example.
Who can write a driver for a TFT if they don't know how to program well?
The Arduino libraries that come with it make everything very easy, but it's still C/C++ with all its difficulties.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---int sensorPin = A0; // select the input pin for the potentiometerint ledPin = 13; // select the pin for the LEDint sensorValue = 0; // variable to store the value coming from the sensor void setup() { // declare the ledPin as an OUTPUT: pinMode(ledPin, OUTPUT);} void loop() { read the value from the sensor: sensorValue = analogRead(sensorPin); digitalWrite(ledPin, HIGH); delay(sensorValue); digitalWrite(ledPin, LOW); delay(sensorValue);}
Dzandaa:
Hi
@coradi:
Here is the code for the "blink" program using AVRPascal:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program TestBlink; {$IF NOT (DEFINED(atmega328p) or DEFINED(arduinouno) or DEFINED(arduinonano) or DEFINED(fpc_mcu_atmega328p) or DEFINED(fpc_mcu_arduinouno) or DEFINED(fpc_mcu_arduinonano))} {$Fatal Invalid controller type, expected: atmega328p, arduinouno, or arduinonano}{$ENDIF} {$mode objfpc} uses defs, timer, digital; const LedPin = 13; //internal LED begin PinMode(LedPin, OUTPUT); DigitalWrite(ledPin, LOW); while True do begin DigitalWrite(ledPin, HIGH); Delay(1000); DigitalWrite(ledPin, LOW); Delay(1000); end;end.
Not very complicated.
B->
coradi:
does AVRF pascal work with STM32?
Does AVR PAscal habe the same lib for nearly any sensor and TFT?!
Does AVRPAscal work with ESp32?
...
But yess, I didn' know avrpascal:-)
It look nice:-)
https://akarwowski.pl/index.php?page=electronics&lang=en
Navigation
[0] Message Index
[#] Next page
[*] Previous page