Install grbl firmware to rasberry pie pico(RP2040))

how can i install grbl firmware to rasberry pie pico?

i added library named grbl which downloaded from github.
but i cant upload to my pico.

error code is
C:\Users*****\Documents\Arduino\libraries\grbl/grbl.h:29:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
exit status 1


my code is

#include <config.h>
#include <coolant_control.h>
#include <cpu_map.h>
#include <defaults.h>
#include <eeprom.h>
#include <gcode.h>
#include <grbl.h>
#include <jog.h>
#include <limits.h>
#include <motion_control.h>
#include <nuts_bolts.h>
#include <planner.h>
#include <print.h>
#include <probe.h>
#include <protocol.h>
#include <report.h>
#include <serial.h>
#include <settings.h>
#include <spindle_control.h>
#include <stepper.h>
#include <system.h>

//grbl firmware_do not modify
//-----------------------------------------------------
#include <SoftwareSerial.h>  //activate hc-06 softwareserial library
#include <DHT11.h> //activate dht library
SoftwareSerial BTserial(2,3); //2-TX, 3-RX

int relay1 = 10;  //PTC Heat-6A
int relay2 = 11;  //PTC Heat-6A
int relay3 = 8;  //LED
int relay4 = 9;  //water pump
DHT11 dht11(26);  //install DHT on pin26


//---setup---
void setup() {
  Serial.begin(9600);  //hc-06 serial begin
  BTserial.begin(9600);  //hc-06 serial rate is 9600
  pinMode(relay1, OUTPUT); //PTC6A relay switch
  pinMode(relay2, OUTPUT); //PTC6A relay switch
  pinMode(relay3, OUTPUT); //LED relay switch
  pinMode(relay4, OUTPUT); //water pump realy
  

  
}


//---loop---
void loop() {
  float temp, humi;
  int ht_result = dht11.read(humi, temp);
  float g_humid = analogRead(27);  //save soil humidity data from pin27
  BTserial.print("습도: ");
  BTserial.print(humi);
  BTserial.print("% ");
  BTserial.print("온도: ");
  BTserial.print(temp);
  BTserial.print(" C"); 
  BTserial.print("토양습도: ");
  BTserial.print(g_humid);
  BTserial.print("% ");
  delay(5000);  //send data each 5 sec
  //send humid, temp, g_humid through hc-06
  
  char cmd;  //command through hc-06
  if(BTserial.available()){
    cmd = (char)BTserial.read();

    if(cmd == '1'){ //PTC on
      digitalWrite(relay1,HIGH);  //PTC Active
      digitalWrite(relay2,HIGH);  //PTC Active
      BTserial.print("Heat mode Activated!"); 
      BTserial.print("Heat mode will be turn off in 30 minitue!"); //나중에 고쳐야지 쉬벌
    }
    if(cmd == '2'){ //LED on
      digitalWrite(relay3,HIGH);
      BTserial.print("LED turned on!");
    }
    if(cmd == '3'){ //Water pump active
      digitalWrite(relay4,HIGH);
      BTserial.print("Water injection!");
      delay(5000);  //Water pump active during 5 sec
    }
    if(cmd == '4'){ //PTC off
      digitalWrite(relay1,LOW);  //PTC Active
      digitalWrite(relay2,LOW);  //PTC Active
      BTserial.print("Heat mode Deactivated!");
    }
    if(cmd == '5'){ //LED off
      digitalWrite(relay3,LOW);
      BTserial.print("LED turned off!");
    }
 //PTC Heater, LED, WP Control through hc-06
}
}

This might help?

thanks

but it also didn't work
maybe it is not compatible with Arduino ide

More likely that grbl isn't compatible with the rp2040. I have loaded grbl to a Uno using the IDE without issues.

yes
i saw grbl works on UNO.
maybe i have to use it.
thx!

Well if that does what you want it would be easiest. There does seem to be a project on github to port grbl to the Pico 9grblHAL) but it's obviously more involved. On the Uno (or other board that will accommodate shields) you can also mount a shield that will take 4 A4988 or DRV8825 stepper drivers so you get a very neat installation.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.