-
This project on the ESP-09 would make for an awesome tiny WiFI enabled device, and if you make it an option to turn on the WiFi portion than it could be low power too. Perhaps logging data into memory then uploading in bursts, I wounder how long something like that could last on a battery?
This is the ESP-09 variant, only 1cm * 1cm
https://imgur.com/XSunTU8,b45rpjB,YBwx2vn,k0DNE9t,TOfxQIFSomeone used this with a 3.3v regulator strapped onto the back to control some WS2812b LED's (even though there's no antenna attached the author claims it still has a 4-10m range) : here
-
-
The connections are correct (Tried reconnecting a few times) and the connector is in the right orientation (I can control the backlight). And i can get things to display with an Arduino (Even on a mega with different pins), I even made a nice Temperature grapher with a DS18B20. But I'd love to program it with Espruino its just funner in JavaScript.
-
Hmm, I can't get this to work. In their init code for u8glib they use different values for setting the LCD bias etc...
Also this display is 132*64 not 128*64
-
Would it be possible to interface with the PI13264 from Pax Instrumets? The PI13264 is a ~3" (Actual pixels diagonally) 132*64 SPI LCD that uses the ST7567 controller. Its perfect to use as the Arduino Shield has a little snap-off piece that breaks out the already easy to use 1mm PCB connector (Which contains the backlight LED). On the Arduino they use a modified version of the u8glib graphics library, which when compaired to Espruino's graphics library is agony to write for.
-
-
-
-
Allow me to clear some things up with some examples.
Espruino's version of interrupts are watches, watches can be set to happen when a pin rises (from low to high), falls (High to low) or both. Watches are set like this:function toggleLED(){ digitalWrite(LED1, !digitalRead(LED1)); } setWatch(toggleLED, BTN1, {repeat:true,edge:"rising", debounce:1/ms/});
This watch executes the ToggleLED function every time button 1 is pressed, this watch also induces a debounce for the button.
Because of Espruino's event driven nature the chip automatically sleeps while nothing is happening to reduce power usage, in Arduino you have to tell the chip to sleep in your program.
Watches can be removed with the function clearWatch(), this function without any arguments deletes all watches currently set. However if when you create your watch you assign it a variable, e.g. Watch1 = setWatch(... , you can pass clearWatch that variable and only remove specific watches.Some more advanced information:
High is at least 1.546v
Low is below 1.166v -
-
-
you might find this useful: https://youtube.com/watch?v=t0ToYhjYV9I
-
The problem is that when you change the variable a interval uses the interval doesn't actually change, to change it you have to assign the interval to a variable and then use the function changeInterval. So to fix your code you could either use changeInterval or use could make the function call itself with timeouts instead of intervals (Timeouts call once after the time then get deleted).
With Timeouts:var c = 1; var time = 15; function flash(){ on = !on; digitalWrite(A0, on); c++; if(c >= 20){ digitalWrite(LED1, 1); } if(c >= 40){ digitalWrite(LED2, 1); } if(c >= 60){ digitalWrite(LED3, 1); } if(c >= 80){ c = 0; digitalWrite([LED1, LED2, LED3],0); time += 25; } setTimeout(flash,time); } flash();
Or with changeInterval:
var c = 1; var time = 15; function flash(){ on = !on; digitalWrite(A0, on); c++; if(c >= 20){ digitalWrite(LED1, 1); } if(c >= 40){ digitalWrite(LED2, 1); } if(c >= 60){ digitalWrite(LED3, 1); } if(c >= 80){ c = 0; digitalWrite([LED1, LED2, LED3],0); time += 25; changeInterval(loop, time); } } var loop = setInterval(flash,time);
-
-
I've just made a modification, more like a dirty little hack, to use clock module.
var Clock = require("clock").Clock; var clk=new Clock(14,6,4,0,0,0,0); // Y,M,D H:M:S IDK,IDK var date;// = "5/6/14"; var json = {"6/3/14":"g","13/3/14":"b","20/3/14":"g","27/3/14":"b","3/4/14":"g","10/4/14":"b","17/4/14":"g","25/4/14":"b","1/5/14":"g","9/5/14":"b","15/5/14":"g","22/5/14":"b","30/5/14":"g","5/6/14":"b","12/6/14":"g","19/6/14":"b","26/6/14":"g","3/7/14":"b","10/7/14":"g","17/7/14":"b","24/7/14":"g","31/7/14":"b","7/8/14":"g","14/8/14":"b","21/8/14":"g","29/8/14":"b","4/9/14":"g","11/9/14":"b","18/9/14":"g","25/9/14":"b","1/10/14":"g","9/10/14":"b","16/10/14":"g","12/10/14":"b","30/10/14":"g","6/11/14":"b","13/11/14":"g","20/11/14":"b","27/11/14":"g","4/12/14":"b","11/12/14":"g","18/12/14":"b","24/12/14":"g","2/1/15":"s","8/1/15":"g","15/1/15":"b","22/1/15":"g","29/1/15":"b","5/2/15":"g","12/2/15":"b","19/2/15":"g","26/2/15":"b","5/3/15":"g","12/3/15":"b","19/3/15":"g","26/3/15":"b","2/4/15":"g","10/4/15":"b","16/4/15":"g","23/4/15":"b","30/4/15":"g","8/5/15":"b","14/5/15":"g","21/5/15":"b","29/5/15":"g","4/6/15":"b","11/6/15":"g","18/6/15":"b","25/6/15":"g","2/7/15":"b","9/7/15":"g","16/7/15":"b","23/7/15":"g","30/7/15":"b","6/8/15":"g","13/8/15":"b","20/8/15":"g","27/8/15":"b","4/9/15":"g","10/9/15":"b","17/9/15":"g","24/9/15":"b","1/10/15":"g","8/10/15":"b","15/10/15":"g","22/10/15":"b","29/10/15":"g"}; function check(){ var type; if(!(date in json)){ console.log("Not a bin day"); }else{ switch(json[date]) { case "g": type = "Green bin"; break; case "b": type = "Brown bin"; break; case "s": type = "Green & Plastic"; break; } console.log("It's a bin day, its the " + type); } } function update(){ var time = clk.getClockTime(); date = Math.floor(time.day + 1) + "/" + time.month + "/" + time.year; check(); } setWatch(function(){update();}, BTN1, {repeat:true,edge:"rising", debounce:5/*ms*/}); //setInterval(update,10000);
-
Putting the bins out is one of my chores, grumble grumble, but i always seem to forget when a bin day is, so as a programming kid i thought a calendar is too simple and boring so i broke out the Espruino and converted my bin dates to JSON. This script currently only checks if the specified date is a bin day and if it it prints what type of bin it is. I plan to use a RTC and a LCD to have this as a clock that can also show notifications, but i need to get a RTC for that (I've got some Chinese ones but there's no Espruino modules and i think they're broken anyway). When i add this all i'll need to do is get the RTC time and add a day (You put the bins out the night before) then either check when i update the clock part or every 10 or 30 mins.
Currently to use just change the date variable to a string like "11/12/14" and press BTN1 or use check()
var date = "5/6/14"; var json = {"6/3/14":"g","13/3/14":"b","20/3/14":"g","27/3/14":"b","3/4/14":"g","10/4/14":"b","17/4/14":"g","25/4/14":"b","1/5/14":"g","9/5/14":"b","15/5/14":"g","22/5/14":"b","30/5/14":"g","5/6/14":"b","12/6/14":"g","19/6/14":"b","26/6/14":"g","3/7/14":"b","10/7/14":"g","17/7/14":"b","24/7/14":"g","31/7/14":"b","7/8/14":"g","14/8/14":"b","21/8/14":"g","29/8/14":"b","4/9/14":"g","11/9/14":"b","18/9/14":"g","25/9/14":"b","1/10/14":"g","9/10/14":"b","16/10/14":"g","12/10/14":"b","30/10/14":"g","6/11/14":"b","13/11/14":"g","20/11/14":"b","27/11/14":"g","4/12/14":"b","11/12/14":"g","18/12/14":"b","24/12/14":"g","2/1/15":"s","8/1/15":"g","15/1/15":"b","22/1/15":"g","29/1/15":"b","5/2/15":"g","12/2/15":"b","19/2/15":"g","26/2/15":"b","5/3/15":"g","12/3/15":"b","19/3/15":"g","26/3/15":"b","2/4/15":"g","10/4/15":"b","16/4/15":"g","23/4/15":"b","30/4/15":"g","8/5/15":"b","14/5/15":"g","21/5/15":"b","29/5/15":"g","4/6/15":"b","11/6/15":"g","18/6/15":"b","25/6/15":"g","2/7/15":"b","9/7/15":"g","16/7/15":"b","23/7/15":"g","30/7/15":"b","6/8/15":"g","13/8/15":"b","20/8/15":"g","27/8/15":"b","4/9/15":"g","10/9/15":"b","17/9/15":"g","24/9/15":"b","1/10/15":"g","8/10/15":"b","15/10/15":"g","22/10/15":"b","29/10/15":"g"}; function check(){ var type; if(!(date in json)){ console.log("Not a bin day"); }else{ switch(json[date]) { case "g": type = "Green bin"; break; case "b": type = "Brown bin"; break; case "s": type = "Green & Plastic"; break; } console.log("It's a bin day, its the " + type); } } setWatch(function(){check();}, BTN1, {repeat:true,edge:"rising", debounce:5/*ms*/});
-
As i understand it the Espruino doesn't multitask all watches, intervals and timeouts happen one after another. I encounter this when i tried to do a watch on a button when i made an infinite loop, woops. Somthing like this wouldn't work.
setWatch(function(){console.log("test");}, BTN1, {repeat:true,edge:"rising", debounce:1/*ms*/}); while(1){ }
-
-
i found this, http://fritzing.org/projects/arduino-l293d its for arduino but it might help you.
-
-
-
-
I'm starting to use the ILI9341 LCD and thanks to the module its super easy. However the one problem is that this LCD is slow, and i know there isn't much we can do about it. I would like to know if there is any way to track pixels changed by drawString as i am writing things to the display i don't want to clear the whole screen as it just takes too long, so maybe if i can track the pixels changed by drawString i can just set those pixels to black instead of clearing the whole screen. Right now i just draw a rectangle over where i think the text will be but that still sets a lot of pixels that were already black and so just wasting time.
I am aware the Espruino doesn't have much memory and so storing all the pixels for the screen in a buffer is just impractical/impossible so i just want to track those that have been changed by drawString.
I think this is possible with a MAX7219 as it uses an array buffer then writes that to the display, but that isn't how it is with the ILI9341.
-
Perhaps you could do something similar to what happens on the espruino code examples where a link opens an app with the code it it from the URI.
Take a look at this post on Android URIs
You will need an app with access to bluetooth, or OTG, so native or you could use PhoneGap if you prefer web languages.
Unfortunately javascript always seems to get limited access :( so even in desktop browsers Bluetooth and usb/serial is no allowed so an app is required
Just curious, whats wrong with these NRF24 Modules?