As the title says... Chat on...

User avatar
By adamjp
#7686 I paid extra for this little oled, but for the ease of use it is excellent. oled: http://www.ebay.com.au/itm/251292095040

photo.JPG
photo.JPG (38.25 KiB) Viewed 5772 times


sample lua script:

Code: Select alli2c.setup(0, 4, 3, i2c.SLOW);
i2c.start(0);
i2c.address(0, 0x27, i2c.TRANSMITTER);
i2c.write(0, 0,"CL","TP",0,0,"TT","LFT",0,"TP",12,0,"TT","RGT",0,"TP",2,2,"TT","some here",0,"TP",4,4,"TT","some here",0);
i2c.stop(0);


letshaveabeer.JPG
letshaveabeer.JPG (36.94 KiB) Viewed 5676 times


Code: Select all-- self documenting long function name
function LetsHaveABeer(beer, ltrs, mids, temp)

   if beer == nil or ltrs == nil or mids == nil or temp == nil then
      print("Argument missing, need string:beer, string:ltrs, string:mids, string:temp");
   end
   --6,10,18,51,120,123,0
   i2c.setup(0, 4, 3, i2c.SLOW);
   i2c.start(0);
   i2c.address(0, 0x27, i2c.TRANSMITTER);
   -- battery
   -- between 1 - 10
   -- TODO
   power = 10;
   i2c.write(0, 0,"CL","DR",112,0,126,10,"LN",127,2,127,8,"FR",114,2,power+114,8);
   -- wifi 
   -- between 1 - 5
   -- TODO
   strength = 3;
   type = "FR";
   for i=0,4 do
      if strength <= i then
         type = "DR"
      end
      i2c.write(0,type,93+i*4,8-i*2,91+i*4,10); 
   end
   -- info
   i2c.write(0,"TP",0,0,"TT","T1 " .. temp.."C",0,"TP",2,2,"SF",18,"TT",beer,0,"SF",0,"TP",0,4,"TT",ltrs .."L",0,"TP",10,4,"TT", mids .. "M",0);
   i2c.stop(0);

end


Hopefully helps some projects along.
Cheers.
Last edited by adamjp on Tue Jan 20, 2015 4:17 am, edited 1 time in total.
User avatar
By alonewolfx2
#7696 It looks very easy but oled screen too expensive. Almost 16$.