Hello everyone! I have a function (as given below) in Julia that was working for Julia 0.4.5.
function pinMode(file_des::SerialPorts.SerialPort , pin_no::Int64 , mode::ASCIIString) m = uppercase(mode) # Prevent errors due to case differences if m == "INPUT" str = "Da"*string(Char(48+pin_no))*"0" end # Dan0 for INPUT if m == "OUTPUT" str = "Da"*string(Char(48+pin_no))*"1" end # Dan1 for OUTPUT str = ascii(str) # Converts UTF8String to ASCIIString write(file_des,str) end
Now, I have Julia 1.6.0 on my machine. As expected, the above-mentioned function is not working on this new Julia. While running this function on Julia 1.6.0, we get an error, as shown below.
LoadError: LoadError: UndefVarError: ASCIIString not defined
I came to know that ASCIIString no longer exists in Base, as given on ASCIIString not defined. On this website, I also found that one can use LegacyStrings package to use ASCIIString. I tried using this package and called LegacyStrings.ASCIIString instead of ASCIIString in the above-mentioned function. However, it didn’t work and later, I realized that LegacyStrings.jl package had not been updated for v0.7/master yet. Could you please help me with how to use ASCIIString in the above-mentioned function on Julia 1.6.0?
Thanking you in anticipation,